Page 1 of 5 123 ... LastLast
Results 1 to 10 of 107

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

Hybrid View

  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
    Aug 2010
    Location
    Nashville, TN
    Beans
    69
    Distro
    Ubuntu Development Release

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

    Woah, that's great. All the stuff I was wondering about lately. Could not figure out why Ubuntu gave no boot options any more. Thanks. You also helped because I am running Ub10.10 on a new Dell-Intelchipset laptop, runs great, only needed a wireless fix. But now trying to get it to run also via Persistent 8GB USB on my 2006 hp desktop, with its nVIDIA chipset, and offline. Walls everywhere on that effort. I can't tell you how many times I reinstalled it on the USB.
    things to do lists
    ... sudo nvidia-xconfig....pray a lot. Then throw it in my home desktop machine. Then add all my laptop's deb packages to the offline hp. I'll be surprised if it works! I can always use Mandriva on the hp though, it comes with working nVIDIA drivers. But I'd rather stick to one distro. My brain might spill open if I try to put too much Linux in it ....too late, goodnight.

    UPDATE:it didn't work.
    Last edited by Mike_tn; November 24th, 2010 at 02:03 AM.

  8. #8
    Join Date
    Sep 2009
    Beans
    1

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

    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.

    ------------------------------------------------------------------------------------------------------------------------------------------------
    I have a duel boot machine (Ubuntu 10.04 and Windows XP) DELL Precision M4400. Yesterday I updated my linux system and after that the screen goes blank after the grub menu if I choose to boot my linux. I see two options: Linux and Windows in the grub menu but when I highlight the Linux option and press "E" nothing happens. I booted my computer with a live cd of Ubuntu and then changed the etc/default/grub file of the already installed ubuntu OS. I have two questions now:

    1. Why did the "E" key did not work ?
    2. How can I run grub update of the already installed system.

  9. #9
    Join Date
    Nov 2009
    Location
    North Vancouver
    Beans
    Hidden!
    Distro
    Edubuntu 14.04 Trusty Tahr

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

    Quote Originally Posted by adilrasheedonline View Post
    [SIZE=4]...I have two questions now:

    1. Why did the "E" key did not work ?
    2. How can I run grub update of the already installed system.
    It sounds like you are describing the Windows Boot Manager, not GRUB - in which case you cannot edit the entry and it wouldn't help anyway (you can confirm this by looking at the top of the screen - it will say Windows Boot Manager or similar). Which means you installed with Wubi... and there is a grub update out on 10.04 that is breaking wubi installs. Look at my comment here: https://answers.launchpad.net/wubi/+question/135755

    If you need more help I suggest you create a new thread as it doesn't relate to this one.

  10. #10
    Join Date
    Jan 2010
    Beans
    1

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

    For those who might be interested, here's my scenario:
    Dell Inspiron 17R, Ubuntu 10.04, would not shut down (hang) nore go into suspend (just did not do anything)

    Started adding stuff to /etc/default/grub and hereis what I got:

    nomodeset -> bombed and X would not start anymore. Had to remove it.

    acpi=off -> shutdown ok (fixed) but no sleep options anywhere. Almost there.

    acpi_osi=\"Linux\" -> perfect, everything works

    Thanks to the original poster
    rmcb

Page 1 of 5 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
  •