Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I change console shell's resolution?, by this i mean the shell when you ctrl+alt+F1. I'm running Ubuntu 9.10, i thought this could be done by changing grub's menu.lst file by with grub2 i really don't know how to achieve this.
Thanks.

share|improve this question
    
Do you want to change the aspect of the console (virtual terminal) or of the GRUB boot loader? It seems to be the first, so in this case the grub2 tag should be removed. –  Cristian Ciupitu Nov 5 '09 at 23:09
2  
No, the bootloader config determines the console resolution, so the grub2 tag is appropriate. –  Ryan Thompson Nov 7 '09 at 21:50
add comment

8 Answers

up vote 4 down vote accepted

Edit /boot/grub/grub.cfg Identify a block that looks like this (your current running kernel):

menuentry "Ubuntu, Linux 2.6.31-14-generic" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set e5ce0bc0-d1b0-4802-a6d4-3fd9fc0e7e58
linux   /boot/vmlinuz-2.6.31-14-generic root=UUID=e5ce0bc0-d1b0-4802-a6d4-3fd9fc0e7e58 ro   quiet splash
initrd  /boot/initrd.img-2.6.31-14-generic
}

Edit the "linux ..." line and, at the end (after "quiet splash"), leave a blank and add something like "vga=773" or another code, depending on the resolution. Here is a list of codes for various resolutions.

Reboot and the new resolution should be enabled.


The provided link gives a list of modes on one particular system; with the 'hwinfo' utility you can generate a list of modes for your system as follows:

hwinfo --framebuffer
share|improve this answer
1  
Thank you. The only problem is that i found out that grub.cfg is not meant to be edited (thats why its in read-only mode). So next time something or someone executes update-grub2 the option will be overwritten. Thank you, if i find out how to do it properly i'll edit my post. –  AlanFL Nov 6 '09 at 20:09
1  
Well, you just have to figure out which file it reads from in order to generate grub.cfg. You can always grep through all of /etc/ for your uuid or some other unique string that the source file would need to contain. –  Ryan Thompson Nov 7 '09 at 23:33
    
MikeH's answer (superuser.com/questions/66428/…) appears to work and does not require editting auto generated files. –  RJFalconer Jan 4 '11 at 17:17
add comment

To add custom boot options to your boot linux from grub 2, you need to edit

/etc/default/grub

find the line that reads

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

and change it to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=ask"

if you know your exact vga= number is, then put that in instead of "ask"

After you edit any of grubs files in /etc you should run

update-grub

to apply the changes

share|improve this answer
1  
It says "ask parameter no longer supported" –  leeand00 Nov 19 '11 at 3:18
add comment

According this excellent howto http://harrison3001.blogspot.com/2009/09/grub-2-graphical-boot-tips-to-set.html it works for me on Ubuntu-Server-9.10.

With the following additions in /etc/default/grub:

GRUB_CMDLINE_LINUX="gfxpayload=true"
GRUB_GFXMODE=1600x1200x32  
GRUB_PRELOAD_MODULES="vbe"

Resolution can be found out via:

hwinfo --framebuffer

I read that x32 is a must.

And modification of /etc/grub.d/00_header:

set gfxmode=${GRUB_GFXMODE} <-- FIND THIS LINE

(as you note GRUB_GFXMODE is the variable we set before through /etc/default/grub)

set gfxpayload=keep <-- THIS IS FOR THE VGA CONSOLE!

(as you note the statement keep, obviously, keeps, what?, the resolution we set before through GRUB_GFXMODE variable set into /etc/default/grub)

insmod gfxterm
insmod ${GRUB_VIDEO_BACKEND}

then run update-grub.

share|improve this answer
add comment

Sorry, vga=ask as well as similar to vga=796 does not work, at least not on my system (acer aspir 5532 laptop). Similar to vga=798 gives me a warning after the grub menu that goes by a bit to fast for me to read (probably in /var/logs somewhere), but it starts with "vga=798 is deprecated", then continues to boot. My vt's are then standard resolution (whatever that is, 800x640?). Giving it vga=ask gives me a "no longer supported" error after grub, "press any key to continue." Pressing a key gives me a "you have to load a kernel first" error and goes back to grub, after which it repeats. To get out of that I had to press "e" in grub and edit the arguments before booting. Guess I could have gone to recovery mode instead and edited /etc/default/grub then run update-grub. If I find something that works I'll post it here, morning the loss of /boot/grub/menu.lst all the while.

share|improve this answer
    
if it's a kernel output msg it should be recorded in dmesg (/var/log/dmesg; just issue the command dmesg, but it's a lot of output, so dmesg | head is perhaps more useful). –  quack quixote Dec 23 '09 at 23:08
add comment

Boot with the vga=ask parameter.

share|improve this answer
add comment

try holding the shift key down while booting. when the menu appears press c for the commandline and then enter "vbeinfo" this will give you a list of supported resolutions for your videocard. It might be that the number representing what you want is there. on mine for example 1152x864x32 is 0x156 I am thinking this 156 number may be what it is looking for?

share|improve this answer
add comment

add this to /etc/default/grub:

GRUB_GFXMODE=1024x768

then run sudo update-grub2

share|improve this answer
    
won't that just tweak Grub's resolution? he's looking to set a different resolution on the kernel framebuffer. –  quack quixote Dec 23 '09 at 23:09
add comment

One way would be to switch back to Grub 1, if you can figure out how. It should be doable, because Karmic still supports Grub 1 for computers that upgrade from 9.04 and earlier versions.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.