4

I'm trying to set the screen resolution in /etc/grub.conf using vga= on the kernel line:

vga=788

I'm using CentOS 6.4.

That command should set the screen resolution to 16bit 800x600 according to antlinux's wiki.

I removed rhgb from the grub.conf file so I can see the details of the boot instead of the progress bar. The problem is that the details on the screen are very small, using and old monitor like most of our customers and changing the VGA setting in grub.conf doesn't seem to change anything for these details being displayed on the screen or the login prompt at the console.

Any ideas on what to change to modify the screen resolution for the details show on the console during boot and login prompt? Setting VGA in grub.conf just doesn't seem to do anything.

/etc/grub.conf:

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-358.el6.i686)
    root (hd0,0)
    kernel /vmlinuz-2.6.32-358.el6.i686 ro root=UUID=8676c199-8498-4de4-8465-c87c2138560f
    rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD 
    SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us
    rd_NO_DM vga=788 quiet
    initrd /initramfs-2.6.32-358.el6.i686.img

UPDATE:

I'm seeing this in /var/log/messages:

Nov 18 16:01:34 localhost kernel: [drm] nouveau 0000:01:00.0: allocated 1024x768 fb: 0x48000, bo df82e400

I think this has something to do with my problem with the resolution changing on me..Still looking into it. Fixed it!! See fix it post below.

  • Do you mean /etc/default/grub? – terdon Nov 18 '13 at 17:08
  • Nope, in CentOS 6.4 it's /etc/grub.conf – GoinOff Nov 18 '13 at 17:24
  • @terdon - right file, but RH keeps it in a different place. It's also under /boot/grub/grub.conf too sometimes. – slm Nov 18 '13 at 17:43
3

Finally figured it out..This is what worked for CentOS 6.4...Results might vary depending on what version you're using...

UPDATE: I decided not to modify the original post but wanted to make sure that nouveau.modeset=0 should be replaced with nomodeset. At least in my case this was a better solution than using nouveau.modeset=0 which only worked on certain hardware.

From looking at /var/log/messages, I noticed that nouveau, which is needed by plymouth was setting the resolution to 1024x768. This caused the resolution to change even though it had been set to something lower using vga=ask in grub.conf. So, the behavior symptoms look like this:

  • First part of the boot uses whatever is set in grub.conf for vga= parm.
  • Shortly after the first part of the boot nouveau kicks in and changes it to the the default (1024x768) or nouveau.modeset=3. You can see this in /var/log/messages.

Fix it by adding this to the kernel line in /etc/grub.conf:

nouveau.modeset=0

It was by default setting it to nouveau.modeset=3 causing 1024x768 even though something else was set using using the vga= setting... The left hand doesn't know what the right hand is doing in this case. What a pain fixing this was...Argggg!!!! I'm sure there is a reason for doing it this way but it seems like nouveau should look at the vga= before defaulting to anything....

/etc/grub.conf:

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-358.el6.i686)
    root (hd0,0)
    kernel /vmlinuz-2.6.32-358.el6.i686 ro root=UUID=6916dd58-165a-4026-8df2-42cd555c8c0f
    rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD
    SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
    nouveau.modeset=0
    initrd /initramfs-2.6.32-358.el6.i686.img

If you are suffering from something similar, check /var/log/messages and see what nouveau is setting for modeset and adjust accordingly in /etc/grub.conf.

If you have a custom installation with a kickstart file, you can add this parm on the bootloader line of ks.cfg:

bootloader --location=mbr --driveorder=sda --append="crashkernel=auto nouveau.modeset=0"

Otherwise, I would change it in /boot/grub/grub.conf and /etc/grub.conf

If you have a custom install of CentOS and you want to control the resolution from the start of the install, try modifying your isolinux.cfg file:

default linux
prompt 1
timeout 0
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
  kernel vmlinuz
  append initrd=initrd.img text ks=cdrom:/ks.cfg nousbstorage resolution=800x600 nouveau.modeset=0
label text
  kernel vmlinuz
  append initrd=initrd.img text nousbstorage resolution=800x600 nouveau.modeset=0
label ks
  kernel vmlinuz
  append ks initrd=initrd.img nousbstorage resolution=800x600 nouveau.modeset=0
label local
  localboot 1
label memtest86
  kernel memtest
  append -
1

I would try using this option instead to start:

kernel .... vga=ask ....

This will get the Kernel to detect what modes are supported and show you them in a list. Once you've identified a usable mode, then you can add that one statically using vga=....

  • That was helpful using vga=ask to see the different resolutions...But, no matter what mode I set it to, the resolution is the same for all boot details after 'Welcome to CentOS' and the login prompt. When I change the mode, it appears like it temporarily changes the resolution properly until the 'Welcome to CentOS' appears. Then it's back to something else which is hard to read. – GoinOff Nov 18 '13 at 18:31
  • @GoinOff - are you talking about when you login, the blue screen? If so that's not controlled by the vga=...` that's controlled by gdm (GNOME Desktop Manager). – slm Nov 18 '13 at 18:57
  • I'm talking about during the boot process up to and including the login prompt on the console. Not running xwindow...No xorg.conf file..No blue screen..GNOME not installed. – GoinOff Nov 18 '13 at 19:12
  • @GoinOff - OK, that is how I took the question, but your previous comment made me think I wasn't understanding you. – slm Nov 18 '13 at 19:13
  • 1
    @GoinOff - the application that takes care of part of the boot screen rendering is called Plymouth. I think the sizing needs to be configured there as well. – slm Nov 18 '13 at 19:15
0

These are the options I've tested for various distributions. Should hopefully help someone out there!

Oracle Linux 6.4

Edit the file:
    /boot/grub/grub.conf
Adding the following entry at the end of the kernel configuration options (note hex):
    vga=0x31a
And remove:
    rhgb quiet
And run:
    grub-install /dev/sda
Then reboot

CentOS 6.4

Edit the file:
    /boot/grub/grub.conf
Adding the following entry at the end of the kernel configuration options:
    vga=794
And run:
    grub-install /dev/sda

Ubuntu 12.04

Set the vga option in the following line: 
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=794"
in the file:
    /etc/default/grub
and run
    update-grub

Reference:
http://ubuntuforums.org/showthread.php?t=1467946

The VGA resolutions can be chosen from the following tables:

http://wiki.antlinux.com/pmwiki.php?n=HowTos.VgaModes http://en.wikipedia.org/wiki/VESA_BIOS_Extensions#Linux_video_mode_numbers

  • Thanks for the input. I tried this and it still doesn't work..I changed the resolution to what is specified for vga= in grub.conf (resolution is OK and set to vga= when penguin appears). Just a little bit before 'Welcome to CentOS' message appears, which shows all the services starting up with OK or Fail messages (Plymouth) the resolution changes back and can hear the click on the monitor to a very small resolution which is a pain to read. Login prompt at the console is also small and hard to read. – GoinOff Nov 19 '13 at 17:06
  • @GoinOff Is the resolution you've chosen supported? Try one of the others from the SVGA table (I'll post a link in my answer). – Thomas Bratt Nov 20 '13 at 11:03
  • @GoinOff Glad you found the answer :) – Thomas Bratt Nov 20 '13 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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