Change your console resolution and colour depth

OK so not much is going on… Thought I might as well pass along some general knowledge.

Changing the resolution of a Linux console is a fairly simple task (and requires a reboot) and is generally a nice thing to do if you intend using the console a lot.

Start off by logging in as root, and open your Grub menu file (mine is in /boot/grub/menu.lst). Next, find the option that would normally boot your Linux system (probably looks something like the following):

kernel /vmlinuz-2.6.8-1-386 root=/dev/hda3 ro

Now, simply append to the end “vga=788″, so it ends up looking something like this:

kernel /vmlinuz-2.6.8-1-386 root=/dev/hda3 ro vga=788

The “788″ is a code which tells the console to be 800×600 with a 16bit colour depth. Check out a table ot codes for all resolutions and colour depths by clicking the “read more” link below this post.

Save the file, reboot, and enjoy :-).

For reference, here are some VGA codes:

   Colors ( depth) 640x480 800x600 1024x768 1280x1024 1600x1200
   ---------------+-------+-------+--------+---------+---------
   256    ( 8 bit)| 769    771     773      775       796
   32,768 (15 bit)| 784    787     790      793       797
   65,536 (16 bit)| 785    788     791      794       798
   16.8M  (24 bit)| 786    789     792      795       799

Comments

  1. Man!, at last i found it!, i’ve been looking for this (whatever the name is) command, argument for so long, and in the most of the cases just finding nothing useful. I’m a console lover, so, i hate to work on the default resolution. Thank you very much for passing along this general knowledge. Hihihihi, not as general as you thought.

  2. ix
    May 15th, 2007 | 22:38

    tanks and thanks, gonna try, hope it works

  3. ix
    May 16th, 2007 | 00:00

    nah. didnt work with my geforce 4400 ti :/
    although grub sais i have vesa 3.0 support

  4. Roma
    October 20th, 2007 | 10:37
  5. November 8th, 2007 | 16:47

    WOW! Thanks for this, working directly on my servers is much easier and better now.

    AnRkey

  6. January 18th, 2008 | 11:32

    thanks for the info! Now I can work happily with the console.

  7. Mac
    April 16th, 2008 | 19:10

    wow … i had a big raise for this man :)
    Thanks

  8. Mike
    February 26th, 2009 | 17:23

    Oh, thanks, it works!

  9. February 28th, 2009 | 15:17

    Thankyou. It’s nice to find straight forward instructions which do exactly what you want.

    Thanks again.

  10. PiroXXI
    April 1st, 2009 | 19:08

    WOOOOW :) That’s exactly what i was looking for ^^ i think it’s just changed my life!!! :p thanks!!!

  11. September 27th, 2009 | 09:32

    In Ubuntu Server 9.04-x64 1280×768 is code: 723

  12. September 27th, 2009 | 09:38

    Woups, I mean:

    In Ubuntu Server 9.04-x64 1280×768 is code: 378
    Not 723 :)

  13. January 26th, 2010 | 14:45

    THANK YOU! It’s much better now!

Leave a reply