<< Spotted?!?! Fifth Generation Google Street View Camera in Zurich | Home | Oh noooooes! javax.el.ELException: [class] is not a valid Java identifier on Apache Tomcat 7 >>

Get more characters onto your Debian Squeeze text mode console

Improved utilization of terminal with Grub 2 + Debian 6 by increasing the screen resolution at boot
Bookmark and Share

In the name of "Keep it simple, stupid!" I don't install the X Windowing system onto my Debian Lenny and Squeeze servers. (And hence no Gnome, no KDE.) What I do change is the screen resolution from the default 640x480 to 1024x768, which any modern monitor can support. This has several advantages:

  • The boot sequence and commands like ls -l will show 56% more lines: 30 vs. 47
  • Commands like ps aux won't wrap as frequently
  • The huge fonts in text-mode 640x480 are just plain ugly
  • Increases the overall number of characters displayed on a single screen by ~2.5x

Step one: Set the resolution for Grub 2. Edit /etc/defaults/grub with your favorite editor. Uncomment the GRUB_GFXMODE line and change the value to 1024x768.

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1024x768

Step two: Have the resolution passed to the kernel when it is loaded. Find the below block around line 126 in /etc/grub.d/00_header and add the set gfxpayload=keep line. I've also commented the edit, but that is optional.

if loadfont `make_system_path_relative_to_its_root "${GRUB_FONT_PATH}"` ; then
  set gfxmode=${GRUB_GFXMODE}
  #keep the gfx mode set in grub (stu)
  set gfxpayload=keep
  load_video
  insmod gfxterm
fi

Step three: Generate a grub2 config file based on the template edits above.

root@zimbali:~# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-5-amd64
Found initrd image: /boot/initrd.img-2.6.32-5-amd64
done

And that's it! On the next boot the resolution will be greater and the text terminal will display many more characters.



Re: Get more characters onto your Debian Squeeze text mode console

After installing the base system of Squeeze, I ran into Bug #617196. The solution, according to the person who filed the bug, is to install xfonts-unicode and then run dpkg-reconfigure on grub.

However, as far as I can tell, a package for xfonts-unicode doesn't exist. How were you able to get around this?

Re: Get more characters onto your Debian Squeeze text mode console

Hi,

I followed those 3 steps on a Virtual Machine (using VMWare Player).
I'm running a Debian Squeeze without any X terminal.

I did what you say and now, I can't boot anymore ... When Grub is showing, I can see that the screen resolution for Grub has been changed, but when I choose the OS to load, i'm stuck after two lines :

Loading Linux 2.6.32-5-686 ...
Loading initial memory disk ...

(I'm not sure about traduction because i'm running it in french but it stops after those 2 lines...)

I tried to go in Grub console mode but I can't find any command to edit files...

Is my VM out of order ?  :s

Re: Get more characters onto your Debian Squeeze text mode console

i did the same thing - appeared to render the vm useless. However, if you hit 'e' when the grub menu appears, add "vga=791" or similar to the linux line and you'll be loading the os again. Undo the changes then.

Re: Get more characters onto your Debian Squeeze text mode console

@Anonymous: I didn't exlicately do anything. The bug report references a different kernel (32-bit and not the 64-bit I've installed.) Is the possibly why?

Re: Get more characters onto your Debian Squeeze text mode console

this solution does not work for me too. But this one does: edit  /etc/default/grub and add "vga=xxx" to GRUB_CMDLINE_LINUX_DEFAULT where xxx is i.e. 791 which stands for 1024x768x16. You can get VGA mods here: http://www.pendrivelinux.com/vga-boot-modes-to-set-screen-resolution/ Then do update-grub, reboot and you are done.

Re: Get more characters onto your Debian Squeeze text mode console

Stu, you're great guy. after implementation the changes from your article I have to reinstall whole server...

Re: Get more characters onto your Debian Squeeze text mode console

If you had to reinstall the entire OS over a grub config change then you are out of your league. Go back to Windows.

Add a comment Send a TrackBack