Page 1 of 11 123 ... LastLast
Results 1 to 10 of 104

Thread: How to set NOMODESET and other kernel boot options in grub2

  1. #1
    Join Date
    Oct 2007
    Beans
    Hidden!

    How to set NOMODESET and other kernel boot options in grub2

    On some hardware configurations, you need to set some kernel parameters for ubuntu to boot or work properly. A common one is nomodeset, which is needed for some graphic cards that otherwise boot in to a black screen or corrupted splash, acpi_osi= to fix lcd backlight and other problems, and noapic and nolapic to work around various ACPI BIOS issues. In this how to I will explain briefly what this is and how to do it.

    This how to applies to ubuntu 10.04 and 10.10. It may not apply to wubi, I dont know how to do it in wubi.
    (update, see post #8 for the differences with wubi)


    What are these options?


    nomodeset

    The newest kernels have moved the video mode setting into the kernel. So all the programming of the hardware specific clock rates and registers on the video card happen in the kernel rather than in the X driver when the X server starts.. This makes it possible to have high resolution nice looking splash (boot) screens and flicker free transitions from boot splash to login screen. Unfortunately, on some cards this doesnt work properly and you end up with a black screen. Adding the nomodeset parameter instructs the kernel to not load video drivers and use BIOS modes instead until X is loaded.

    Note that this option is sometimes needed for nVidia cards when using the default "nouveau" drivers. Installing proprietary nvidia drivers usually makes this option no longer necessary, so it may not be needed to make this option permanent, just for one boot until you installed the nvidia drivers.

    acpi_osi=
    This option frequently solves problems with LCD backlight, fan control problems and misreporting of thermal events. What I understand it does (but corrections are welcome), is prevent the kernel from reporting to the bios that its any windows version the bios asks for. By default, the kernel pretends to be all windows versions, that way we are certain the bios executes all the code needed to initialize the hardware. Unfortunately, some bioses contain fixes to fix problems with specific windows versions (notably vista) that arent needed or dont work for other OS's. Setting
    Code:
    acpi_osi=
    (nothing behind the = sign) as boot option makes the kernel not respond to osi queries.

    If the bios has provisions for Linux, you can also try
    Code:
    acpi_osi="Linux"
    Or you can try
    Code:
    acpi_osi="Windows 2006"
    To make the kernel pretend its vista and make the bios execute routines on machines that require them.

    acpi=off
    This disables ACPI completely.
    Note: this may not work with all computers and will disable a lot of useful (or even needed) features. In some cases it may even disable some crucial features, like.. fans. Be careful with this option, it might cause your machine to overheat if the fans no longer turn. Think of this as a last resort. Also note some machines require acpi=ht instead.

    Noapic and nolapic
    noapic and nolapic kernel options instruct the kernel to not use certain programmable interrupt controllers. To understand what that means exactly requires a deep knowledge of PC hardware, I will not go in to that here, Ill limit myself to saying on some bioses, especially for older systems, there are problems in the implementation of this and it may be necessary to disable either or both to cure a wide range of obscure problems, often but not always related to keyboard and mouse and power management (standby/resume issues).

    vmalloc=xxxM
    In some cases kernel drivers can not be loaded due to a lack of virtual addressing space on 32 bit systems. Logs will show errors like
    Code:
    allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.
    Details can be found here:
    http://www.mythtv.org/wiki/Common_Pr...lloc_too_small

    This has been reported by extremejosh who's machine failed to load the restricted nvidia drivers on a geforce 7350 and appears more or less common if you have several tv tuners. Increasing the size of vmalloc to 196 or even more may help in such cases.

    How to enable kernel options on the livecd (before install)

    If you boot ubuntu from a livecd (or USB stick), right after the bios splash screen you will get a purple screen with a keyboard logo at the bottom:



    Press any key at that moment to access a menu. Select your language with the arrow keys, press enter and you will see this menu:



    If you press the F6 key, a menu at the bottom will open allowing you to set kernel options with the space bar or enter key. You can close the menu with escape key and resume booting by selecting the option “try ubuntu without installing” (please note that session does allow you to install ubuntu once you found the kernel options cured your problem).

    If you need to add kernel options not provided by the F6 menu, you can just type them in at the end of the boot options line.

    Important: if you select a kernel boot option from the F6 menu and proceed to boot and later install ubuntu, those boot options will NOT be applied to your installation. If you needed nomodeset to get the livecd to boot, you will almost certainly need it again once you reboot in to your fresh install. See below how to set those options on an installed ubuntu. And perhaps click the “affects me too” on this bug report where I request these settings be applied (semi) automatically.

    How to temporarily set kernel boot options on an installed OS (not wubi)

    To set kernel boot options, you must edit your grub configuration. You can do this temporarily for a single boot by entering the grub menu. If you do not get to see the grub boot menu after the bios automatically, you may have to press SHIFT key after the bios logo to get in to grub:



    Select the default ubuntu kernel (usually the top one), and rather than pressing enter, press E to edit.

    Press DOWN ARROW until you get to the line that starts with

    Code:
    linux /boot
    and press END keys to position your cursor at the end of the that line usually ending with “quiet splash”.

    Now you can type in additional kernel options like nomodeset (please dont make the same typing error I made for this screenshot ):



    press control+X to boot the modified grub entry.

    Important: setting boot options this way only applies to a single boot. If you reboot the machine, those settings will be lost, unless you make them permanent (see below)

    How to permanently set kernel boot options on an installed OS (not wubi)

    To permanently change the default kernel boot options, press ALT+F2 or open a terminal from system > accessories > terminal. Type in the following command:

    Code:
    gksudo gedit /etc/default/grub
    a text editor will open with the grub configuration file. Near the top of that file you will see something very similar to this:
    Code:
    GRUB_DEFAULT=0
    #GRUB_HIDDEN_TIMEOUT=0
    GRUB_HIDDEN_TIMEOUT_QUIET=true
    GRUB_TIMEOUT=10
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    GRUB_CMDLINE_LINUX=""
    add your custom boot options to the GRUB_CMDLINE_LINUX_DEFAULT line, so for instance:

    Code:
    GRUB_DEFAULT=0
    #GRUB_HIDDEN_TIMEOUT=0
    GRUB_HIDDEN_TIMEOUT_QUIET=true
    GRUB_TIMEOUT=10
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
    GRUB_CMDLINE_LINUX=""
    Save the file and exit gedit. If you have to add kernel options that contain quotation marks, add them as such:

    Code:
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset acpi_osi=\"Linux\""
    Now in the terminal, run the following command to update your grub configuration with the new default settings:
    Code:
    sudo update-grub
    Thats all.

    To do: wubi part.
    Last edited by P4man; February 9th, 2011 at 01:40 PM.

  2. #2
    Join Date
    Jan 2009
    Location
    Flanders
    Beans
    Hidden!

    Re: How to set NOMODESET and other kernel boot options in grub2

    great tutorial,

    I will put it in my signature. Maybe you can tell something about the "acpi=off" option too.

  3. #3
    Join Date
    Oct 2007
    Beans
    Hidden!

    Re: How to set NOMODESET and other kernel boot options in grub2

    acpi=off really is a "nuclear bomb" solution IMHO. APCI is an essential part of any somewhat modern PC and turning it off can cause bigger issues than it solves (disable fans etc). If you need it, the above tutorial can help in setting the option, but Im reluctant to advertise the option. acpi_osi= is one option I may add later though.

  4. #4
    Join Date
    Jan 2009
    Location
    Flanders
    Beans
    Hidden!

    Re: How to set NOMODESET and other kernel boot options in grub2

    I needed to use the acpi=off option with ubuntu versions 9.xx and recently, I've seen someone else who needed to use it with 10.10. Can acpi_osi=... solve the same problems? And what are the differences between the two?

  5. #5
    Join Date
    Oct 2007
    Beans
    Hidden!

    Re: How to set NOMODESET and other kernel boot options in grub2

    acpi_osi= doesnt disable turn off all acpi functions. It just makes the kernel not pretend its windows to the acpi bios and that can avoid problems with bioses where windows errata are fixed in bios for a specific windows OS (by default linux will pretend to be any windows version). More details here:

    ftp://ftp.suse.com/pub/people/trenn/...or_vendors.pdf

    adding acpi_osi= commonly fixes problems with LCD backlight, due to a bug in vista that vendors "fixed" in the bios.

  6. #6
    Join Date
    Jun 2008
    Location
    Switzerland
    Beans
    8
    Distro
    Ubuntu

    Smile Re: How to set NOMODESET and other kernel boot options in grub2

    Really a valuable how-to. It's only thanks to it, that my new and rather expensive Panasonic Toughbook became usable for me.
    Meanwhile I made the boot option "acpi_osi=" permanent in the proper place /etc/default/grub, as explained above. My gratitude to P4man !

  7. #7
    Join Date
    Oct 2007
    Beans
    Hidden!

    Re: How to set NOMODESET and other kernel boot options in grub2

    Can anyone with wubi experience point me in the right direction how to do this in wubi? Wubi uses grub4dos right? Or windows bootloader chainloading grub4dos ?

  8. #8
    Join Date
    Nov 2009
    Location
    North Vancouver
    Beans
    Hidden!
    Distro
    Edubuntu 12.04 Precise Pangolin

    Re: How to set NOMODESET and other kernel boot options in grub2

    Wubi overrides are identical to what is in post #1 - once it is installed.

    To override on the initial install is different and to complicate things, since Ubuntu 11.10 there are two distinct methods to install with Wubi. NOTE: this initial Wubi-specific override is effective only for a single boot. After that you need to either make it permanent or continue to override as shown in post #1.

    Method 1 (traditional way, if you downloaded the ISO or ran installed from a CD): after the windows part is completed you reboot to do the actual install (ubiquity is setup to auto-install to the defined virtual disk based on settings provided to wubi.exe in windows).

    The first time you select Ubuntu from the windows boot manager, you'll see
    Code:
    Completing the Ubuntu installation
    For more installation options, press ESC now 5...4...3...2...1
    When you press ESC you get 5 options...
    Code:
    Normal mode  (the only option that uses 'quiet splash'; the rest all run ubiquity in debug mode)
    Safe graphic mode (uses 'xforcevesa')
    ACPI workarounds (uses 'acpi=off noapic nolapic')
    Verbose mode (no special override, just debug mode)
    Demo mode (I don't know what this is supposed to do but it doesn't work at all on my test computer)
    You can select any one of the above, however safe graphic mode doesn't do much for the nvidia problem, so I prefer to just hit 'e' on the first entry (Normal) and add 'nomodeset' prior to 'quiet splash'. Then CTRL+X to boot.

    The full entry looks something like this after adding nomodeset (local settings for language/keyboard differ):
    linux /ubuntu/install/boot/vmlinuz debian-installer/custom-installation=/ubuntu/install/custom-installation iso-scan/filename=/ubuntu/install/installation.iso automatic-ubiquity noprompt nomodeset quiet splash boot=casper ro debian-installer/locale=en_US.UTF-8 console-setup/layoutcode=us console-setup/variantcode= -- rootflags-syncio
    initrd /ubuntu/install/boot/initrd.lz
    In the same way as the non-wubi install, the override is only in place for as long as the installation process. After the unattended install the computer reboots, and the next time you select Ubuntu you get a normal looking grub menu (looks identical to normal installs at a high level) and you have to again apply the override as described in post #1. After that, either install drivers, or override using permanently using /etc/default/grub.

    Method 2:
    New with release 11.10, if you run wubi.exe standalone it will download a preinstalled image while in Windows, and there is no 2nd stage install anymore. But on the first boot there is no way to override boot options on the fly. You have to do it in Windows by editing the file: \ubuntu\install\wubildr-disk.cfg

    It looks like this:
    loopback loop0 /ubuntu/disks/root.disk
    set root=(loop0)
    search --set=diskroot -f -n /ubuntu/disks/root.disk
    probe --set=diskuuid -u $diskroot
    linux /vmlinuz root=UUID=$diskuuid loop=/ubuntu/disks/root.disk preseed/file=/ubuntu/install/preseed.cfg wubi-diskimage ro quiet splash nomodeset
    initrd /initrd.img
    boot
    Add boot options after "quiet splash" and then save before rebooting into Ubuntu. I recommend using WordPad (write.exe) as the file has linux style line endings.

    In the same way as the non-wubi install, the override is only in place for the first boot. However, with Method 2 wubi installs, you can make the override permanent as soon as it's booted. Refer to post#1 for specific instructions on how to do this... i.e. install drivers, or override permanently using /etc/default/grub.

    NOTE: the grub menu is now hidden by default on Wubi installs. Especially with method #2, if it's not working make sure you hold down the Shift key after selecting Ubuntu. This tells grub to display the menu. If you get that grub menu, then you need to follow the override instructions from post #1.
    Last edited by bcbc; May 12th, 2012 at 01:26 AM. Reason: Add comment on how to display grub menu

  9. #9
    Join Date
    Oct 2007
    Beans
    Hidden!

    Re: How to set NOMODESET and other kernel boot options in grub2

    Thanks a lot bcbc. Ill incorporate that info soon. First Im gonna see if I can mess up my windows VM by installing wubi so I can actually test it (and grab some screenies).

  10. #10
    Join Date
    Oct 2006
    Location
    Slovakia
    Beans
    590
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Re: How to set NOMODESET and other kernel boot options in grub2

    Perfect idea! Although the "nomodeset" option didn't work at all (caused my ubuntu to run in low-graphics mode), the "acpi_osi=" on the other hand really solved all my ACPI problems, such as screensaver working erratically, battery state not reflecting reality and brightness keys not working (Toshiba Satellite A300)! You're a genius!
    בראשית ברא אלהים את השמים ואת הארץ׃

Page 1 of 11 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •