Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old September 16th, 2006   #1
Indras
A Carafe of Ubuntu
 
Join Date: Jun 2006
Location: Michigan, US
Beans: 119
Ubuntu 6.06
HOWTO: Change bootup and console resolution

I've seen a few questions about this on the forums, so I've decided to write a full-fledged tutorial on how to set this up in Ubuntu. This will show you how to change your screen's resolution while booting, during usplash, and at any time one one of the text consoles (by pressing CTRL+ALT+F1 through F6). I'll try to make this as friendly as possible for newbies, and I'll make sure to explain all acronyms and abbreviations at least once.

Explanation: (feel free to skip this section, it is only for educational purposes)

Your computer system boots up in multiple stages, each one using the video card and monitor in its own way. This is important to know when tracking down resolution problems.

First, your computer's BIOS (Basic Input-Output System) detects and powers up your video card during POST (the Power On Self Test) and uses it to display all of its relevant information, such as the memory check, a list of devices, and so on. Some motherboards will simply display a full-screen logo, particularly branded PCs, like Hewlett Packard and Compaq. You may have to press the spacebar or escape key to see what's going on behind the logo. Each PC is different, so consult your vendor's support site, your computer's manual, or, if all else fails, google.com.

The BIOS generally chooses a generic resolution that will work on nearly any video card and monitor, like 640x480x8, so as to not have an error message that the user is unable to read. I've only seen a couple computers where this resolution could be configured, as it's not a high priority option.

Then, your bootloader starts, using the resolution already in place. This may be ntldr, on Windows NT/2000/XP systems, darwin on macintosh systems, or Lilo/Grub on Linux systems. Ubuntu Dapper defaults with a basic plaintext grub. See the gfxboot grub tutorial here on ubuntuforums if you'd like to use the graphical grub that Suse has: http://www.ubuntuforums.org/showthread.php?t=208855 However, I'm going to assume you're using default options from here on.

After you choose your operating system and kernel in grub, or it automatically defaults to the first option if you do not press a key during the 3 second countdown, it fires up the kernel and passes it bootup parameters. There are many different parameters you can send to the kernel before bootup, such as 'single', for single-user mode.

The kernel uses it's own video card driver. In Ubuntu, it uses the basic vesafb driver, short for vesa framebuffer. This is a simple, generic, non-accelerated driver, which is optimal for compatibility. Once again, the point is to never have something bad happen and an error message displayed on the screen that the user cannot see. There are still users out there whose monitors cannot display above 800x600, and if your kernel tried to run the vesafb at a resolution higher than this, those users would be alienated.

If grub does not pass a vga parameter to the kernel, it assumes vga=normal, which is 640x480 resolution. From then on, everything running will be at that basic vga resolution, except for the xserver. First, your usplash screen displays, while all other services are starting. This is the screen with an orange Ubuntu logo at the top of the screen and a list of processes starting up in the bottom half. There's also a howto on the forums for changing the colors of the usplash screen, located here: http://www.ubuntuforums.org/showthread.php?t=82835.

Near the end of the bootup sequence, it starts up six consoles, using the getty program, and then the xserver. The first six consoles can be accessed any time by pressing CTRL+ALT+F(x) where x is the number of the console. The xserver then binds itself to F7, the next available number. Try it now if you feel like, by holding CTRL and ALT and go through F1 through F7.

The consoles always use the vesafb driver to display, so they are at the same resolution that was passed to your kernel from grub. The xserver uses its own driver and resolution, defined by /etc/X11/xorg.conf, and then Gnome, KDE, or XFCE run on top of it. I won't go into detail here on how they work.

End explanation section

Okay, if you jumped ahead, here's where you should start paying attention. First, I'm going to give you the vesafb modes table. This was taken from http://www.tldp.org/HOWTO/Framebuffer-HOWTO-5.html, so feel free to go there for more information.

The Table
HTML Code:
Colours   640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
--------+--------------------------------------------------------------
 4 bits |    ?       ?     0x302      ?        ?        ?         ?
 8 bits |  0x300   0x301   0x303    0x305    0x161    0x307     0x31C
15 bits |    ?     0x310   0x313    0x316    0x162    0x319     0x31D
16 bits |    ?     0x311   0x314    0x317    0x163    0x31A     0x31E
24 bits |    ?     0x312   0x315    0x318      ?      0x31B     0x31F
32 bits |    ?       ?       ?        ?      0x164      ?

(I apologize for the way this table looks, it's the only way I could get the columns to line up)

So first, choose which resolution you'd like to run your consoles and usplash in from the chart above.

Now, open your menu.lst file:
Code:
sudo nano /boot/grub/menu.lst
And find the entry you normally use to boot with and go to the line that begins with "kernel", it should say something like this:
Code:
kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda5 ro quiet splash
Add a "vga=" option to the end of the line, and put in the code from the table above. So if you want 1024x768 at 16 bit color at command line, add "vga=0x317" to the end of your kernel parameters. This is the option I like to use most. You also can use the decimal equivalent, since 0x317 is in hex. The decimal equivalent is 791, so you'd use "vga=791" instead.

Now, save the file, and it will take effect when you restart.

Note: Normally, when you upgrade your kernel or run grub-reconfigure, it will remove this option and set it back to defaults. In order to make this change permanent, go up a couple lines to one that looks like this:
Code:
# defoptions=quiet splash
(yes, it's commented out, but grub-reconfigure looks for this (and other) commented-out options when rebuilding your grub menu)

And add the same vga= option to the end of that as well, and it will make this new resolution permanent, even after new kernels are installed.

Another ubuntuforums member, Herman, made a very important suggestion: you can make modifications to your grub boot sequence for a single boot by editing grub before you boot. Since it does not alter Grub's menu.lst file, the change isn't permanent. When grub first boots up, at the GUI menu, select an option you want to modify and press the 'e' key. This will bring up the full list of commands from the menu.lst file that grub uses to boot that particular option. From there, you can go to your kernel line and add the vga option there, just like in my instructions above, and it will boot Ubuntu a single time with a different vesafb resolution.

As a bonus, here's some extra tidbits, some of it useless knowledge, for your perusal:
  • For the mathematically challenged, there is a hex to decimal converter in Ubuntu. Go to Applications->Accessories->Calculator. From there, go to View->Scientific. Right under the display screen is a button for Hex. Press it and type the code from the table above (like 31C) and press the Dec button.
  • When booting from the LiveCD, you can change this option as well, but you have to do it while still at the graphical grub menu. When the CD boots and shows the Ubuntu logo with a 30 second timeout, press the escape key. A box will come up warning you about going to the text-based grub interface. Just press enter. This will drop you to a boot: prompt. Type "live vga=791", or whatever your desired resolution is, and then the liveCD will boot its kernel at this resolution. Note that this is temporary for one boot only.
  • You can set "vga=ask" in your menu.lst file to force the kernel to ask you what resolution you prefer each time, but you will choose from a rather small list of options. You can type "scan" to have it check your hardware to see which modes it is capable of, but this is mainly for compatibility issues, and it won't give you as complete of a list as above, and you cannot type in 791, or 0x317 here, only a number from 0 to 9 from the list it gives you.
If you see any incorrect information here in this tutorial, or you have something notable to add, please reply below and I'll try my best to make the changes in good time. I do my best to visit the forums daily, so hopefully I'll catch it quickly.

Also, if you're looking for some very well written, illustrated information on using grub to its fullest, please visit Herman's website on grub here: http://users.bigpond.net.au/hermanzone/p15.htm

Last edited by Indras; September 17th, 2006 at 07:43 AM..
Indras is offline   Reply With Quote
Old September 21st, 2006   #2
Indras
A Carafe of Ubuntu
 
Join Date: Jun 2006
Location: Michigan, US
Beans: 119
Ubuntu 6.06
Re: HOWTO: Change bootup and console resolution

Just a quick little update... here's the full table in easy to read (and easy to remember) decimal format.

HTML Code:
Colours   640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
--------+--------------------------------------------------------------
 4 bits |    ?       ?      770       ?        ?        ?         ?
 8 bits |   768     769     771      773      353      775       796 
15 bits |    ?      784     787      790      354      793       797 
16 bits |    ?      758     788      791      355      794       798 
24 bits |    ?      786     789      792       ?       795       799 
32 bits |    ?       ?       ?        ?       356       ?


I've also seen questions from people wanting widescreen resolutions. I'm sorry, but it seems that vesafb doesn't support any resolution not in the table above.
Indras is offline   Reply With Quote
Old September 25th, 2006   #3
ethan@xmlstandards.org
5 Cups of Ubuntu
 
Join Date: Mar 2006
Location: London
Beans: 27
Ubuntu 6.06 Dapper
Send a message via MSN to ethan@xmlstandards.org
Re: HOWTO: Change bootup resolution

Thanks so much for this post.

I have used all of the features you mentioned to great benefit.

Much appreciated.

Ethan Cane
Web Developer
ethan@xmlstandards.org is offline   Reply With Quote
Old September 29th, 2006   #4
pejcao
First Cup of Ubuntu
 
Join Date: Sep 2005
Beans: 7
Re: HOWTO: Change bootup resolution

same 4 edgy?
pejcao is online now   Reply With Quote
Old October 18th, 2006   #5
DonnieP
A Carafe of Ubuntu
 
DonnieP's Avatar
 
Join Date: Oct 2006
Location: Richmond, VA USA
Beans: 119
Ubuntu 9.04 Jaunty Jackalope
Re: HOWTO: Change bootup resolution

This works for me in edgy, but just a note that the 1152x864 resolution doesn't seem to be recognized. It gives an error message and presents the limited 1-9 menu listed in the explanation above.
DonnieP is offline   Reply With Quote
Old October 31st, 2006   #6
meimato
Just Give Me the Beans!
 
Join Date: Nov 2004
Beans: 53
Re: HOWTO: Change bootup resolution

I've always used this nice feature, but now in Edgy it doesn't seem to work: the boot screen appears not centered on the screen, but rather in the top left corner.
meimato is offline   Reply With Quote
Old October 31st, 2006   #7
livinginx
Just Give Me the Beans!
 
Join Date: Oct 2006
Location: East Betehl, MN, USA
Beans: 77
Ubuntu 7.10 Gutsy Gibbon
Send a message via AIM to livinginx
Re: HOWTO: Change bootup resolution

Nice info, but I am trying to figure out for the default login screen.
livinginx is offline   Reply With Quote
Old October 31st, 2006   #8
Kerry Lange
A Carafe of Ubuntu
 
Join Date: Jun 2006
Location: Victoria Canada
Beans: 109
The Feisty Fawn Testing
Re: HOWTO: Change bootup resolution

Sorry, re-read the thread and saw anything other than what's in the table is not supported.

What do I need to use if I'm trying to achieve 1900 x 1200 at 24 or 32 bit?

Last edited by Kerry Lange; October 31st, 2006 at 07:58 PM..
Kerry Lange is offline   Reply With Quote
Old October 31st, 2006   #9
techstop
Quad Shot of Ubuntu
 
Join Date: Nov 2005
Beans: 473
Ubuntu 9.10 Karmic Koala
Re: HOWTO: Change bootup resolution

Quote:
Originally Posted by meimato View Post
I've always used this nice feature, but now in Edgy it doesn't seem to work: the boot screen appears not centered on the screen, but rather in the top left corner.
I've only just found the feature, and yes, the boot screen is not centred. Anyone know how to fix this? BTW,tty1-6 is awesome at high res, thanks for the pointer!
techstop is offline   Reply With Quote
Old November 1st, 2006   #10
dizzie
Just Give Me the Beans!
 
dizzie's Avatar
 
Join Date: Mar 2005
Location: Denmark
Beans: 50
Ubuntu Karmic Koala (testing)
Re: HOWTO: Change bootup resolution

If only 1280x800 was supported...
__________________
Mainboard : Asus Striker-II | CPU : E8400 3 GHz
RAM: 16GB DDR2 (1066) | Video: 2x Geforce 9800 GT
HDD: 2x 320GB | Display: 2x 23" @ 1920x1084 (HP 2309m)
Linux: Ubuntu 9.04 & 9.10 (testing)
dizzie is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:02 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry