CentOS boot time screen resolution

boot-loadercentosgrub-legacylinux-kernel

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 800×600 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.

Best Answer

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 -
Related Question