Page 1 of 4 123 ... LastLast
Results 1 to 10 of 40

Thread: How to add Android-x86 entry to GRUB2?

  1. #1
    Join Date
    Nov 2015
    Beans
    22

    How to add Android-x86 entry to GRUB2?

    Hello guys. Today, I have installed Android-x86 5.1 on sda9. I have dual-booted Windows 10 and Ubuntu 14.04. So, when Android installation asked me if I want to install GRUB or not, I selected No, because I already have GRUB. But there isn't Android-x86 entry in GRUB so I'm unable to boot into Android.

    Can anyone help me? Thanks in advance.

  2. #2
    Join Date
    Jun 2010
    Location
    London, England
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How to add Android-x86 entry to GRUB2?

    As a preliminary action you can load into Ubuntu & run this command

    Code:
    sudo update-grub
    That will produce a printout. What you see in the printout is what will appear in the Grub boot menu. If you see a reference to android-x86 then you may not need to do anything more.

    Regards.
    It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
    Ubuntu user #33,200. Linux user #530,530


  3. #3
    Join Date
    Nov 2015
    Beans
    22

    Re: How to add Android-x86 entry to GRUB2?

    Quote Originally Posted by grahammechanical View Post
    As a preliminary action you can load into Ubuntu & run this command

    Code:
    sudo update-grub
    That will produce a printout. What you see in the printout is what will appear in the Grub boot menu. If you see a reference to android-x86 then you may not need to do anything more.

    Regards.
    There is output:
    Code:
    ninja@inspiron:~$ sudo update-grub[sudo] password for ninja: 
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-3.19.0-42-generic
    Found initrd image: /boot/initrd.img-3.19.0-42-generic
    Found linux image: /boot/vmlinuz-3.19.0-25-generic
    Found initrd image: /boot/initrd.img-3.19.0-25-generic
    Found Windows Boot Manager on /dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi
    Adding boot menu entry for EFI firmware configuration
    error: $.
    error: syntax error.
    error: Incorrect command.
    error: syntax error.
    Syntax error at line 262
    Syntax errors are detected in generated GRUB config file.
    Ensure that there are no errors in /etc/default/grub
    and /etc/grub.d/* files or please file a bug report with
    /boot/grub/grub.cfg.new file attached.
    done

  4. #4
    Join Date
    Jun 2005
    Beans
    Hidden!

    Re: How to add Android-x86 entry to GRUB2?

    Hi george133
    After you've installed both Ubuntu and Android-x86, you need to boot into Ubuntu and modify the "40_custom" GRUB script:
    Code:
     gksu gedit /etc/grub.d/40_custom
    And at the bottom of the file, add this:
    Code:
    menuentry "Android-x86" {
    set root='(hd0,0)'
    linux /android-4.0-RC1/kernel quiet root=/dev/ram0 androidboot.hardware=eeepc acpi_sleep=s3_bios,s3_mode SRC=/android-4.0-RC1 SDCARD=/data/sdcard.img
    initrd /android-4.0-RC1/initrd.img}

    Please note the difference in kernels change to the one you are on.
    If you haven't installed Android-x86 4.0 RC1 but some other version, replace the lines containing "android-4.0-RC1" with your version.
    For Android-x86 versions older than 4.0, use "androidboot_hardware" instead of "androidboot.hardware"
    There is more here you need to see http://www.webupd8.org/2012/03/how-t...nd-ubuntu.html
    He also has a video at the top part of that link above^^^^^^^

    There are some changes you'll need to make to the above menu entry (code above):
    If you didn't create an sdcard image, remove the "SDCARD=/data/sdcard.img" part from the 3rd line (make sure you don't remove anything else!)
    The above menu entry uses "eeepc" for androidboot.hardware, but you can replace it with your hardware, depending on the ISO you've downloaded (use "asus_laptop" for the ASUS Laptop ISO, etc.) or use "generic_x86".
    If you haven't installed Android-x86 4.0 RC1 but some other version, replace the lines containing "android-4.0-RC1" with your version.
    For Android-x86 versions older than 4.0, use "androidboot_hardware" instead of "androidboot.hardware"
    But the most important thing you need to change in the menuentry is the partition on which you've installed Android-x86, "(hd0,0)" in my example. If you don't know on which partition you've installed it, run the following command in a terminal:
    Code:
    sudo fdisk -l
    so I've replaced "(hd0,0)" with "(hd0,6)" - hd0 means the first hard disk ("sda") and "6" is the partition and comes from "sda6".


    Hard disk naming starts with 0 so basically, sda is "hd0", sdb is "hd1" and so on. Counting partitions doesn't start with 0, so if you've installed Android x86 on let's say "sda5", you'd use "(hd0,5).
    Once you make these changes, save the file.
    Now let's make the file executable and update GRUB 2:
    Code:
    sudo chmod +x /etc/grub.d/40_custom
    sudo update-grub

    That is about it, Hope this helps.
    Kind regards
    Last edited by QDR06VV9; December 26th, 2015 at 08:19 PM.

  5. #5
    Join Date
    Nov 2015
    Beans
    22

    Re: How to add Android-x86 entry to GRUB2?

    Quote Originally Posted by runrickus View Post
    Hi george133
    After you've installed both Ubuntu and Android-x86, you need to boot into Ubuntu and modify the "40_custom" GRUB script:
    Code:
     gksu gedit /etc/grub.d/40_custom
    And at the bottom of the file, add this:
    Code:
    menuentry "Android-x86" {
    set root='(hd0,0)'
    linux /android-4.0-RC1/kernel quiet root=/dev/ram0 androidboot.hardware=eeepc acpi_sleep=s3_bios,s3_mode SRC=/android-4.0-RC1 SDCARD=/data/sdcard.img
    initrd /android-4.0-RC1/initrd.img}

    Please note the difference in kernels change to the one you are on.
    If you haven't installed Android-x86 4.0 RC1 but some other version, replace the lines containing "android-4.0-RC1" with your version.
    For Android-x86 versions older than 4.0, use "androidboot_hardware" instead of "androidboot.hardware"
    There is more here you need to see http://www.webupd8.org/2012/03/how-t...nd-ubuntu.html
    He also has a video at the top part of that link above^^^^^^^

    There are some changes you'll need to make to the above menu entry (code above):
    If you didn't create an sdcard image, remove the "SDCARD=/data/sdcard.img" part from the 3rd line (make sure you don't remove anything else!)
    The above menu entry uses "eeepc" for androidboot.hardware, but you can replace it with your hardware, depending on the ISO you've downloaded (use "asus_laptop" for the ASUS Laptop ISO, etc.) or use "generic_x86".
    If you haven't installed Android-x86 4.0 RC1 but some other version, replace the lines containing "android-4.0-RC1" with your version.
    For Android-x86 versions older than 4.0, use "androidboot_hardware" instead of "androidboot.hardware"
    But the most important thing you need to change in the menuentry is the partition on which you've installed Android-x86, "(hd0,0)" in my example. If you don't know on which partition you've installed it, run the following command in a terminal:
    Code:
    sudo fdisk -l
    so I've replaced "(hd0,0)" with "(hd0,6)" - hd0 means the first hard disk ("sda") and "6" is the partition and comes from "sda6".


    Hard disk naming starts with 0 so basically, sda is "hd0", sdb is "hd1" and so on. Counting partitions doesn't start with 0, so if you've installed Android x86 on let's say "sda5", you'd use "(hd0,5).
    Once you make these changes, save the file.
    Now let's make the file executable and update GRUB 2:
    Code:
    sudo chmod +x /etc/grub.d/40_custom
    sudo update-grub

    That is about it, Hope this helps.
    Kind regards
    Thank you very much!

    Quote Originally Posted by runrickus View Post
    Hi george133
    After you've installed both Ubuntu and Android-x86, you need to boot into Ubuntu and modify the "40_custom" GRUB script:
    [CODE] gksu gedit /etc/grub.d/40_custom
    Sir, after this, I'm getting error when I'm opening Grub Customizer. Here is it:
    Can you help me?

    Also, when I run
    Code:
    sudo update-grub
    I'm getting this output:
    Code:
    ninja@inspiron:~$ sudo update-grub
    Generating grub configuration file ...
    /etc/grub.d/40_custom: 1: /etc/grub.d/40_custom: menuentry: not found
    /etc/grub.d/40_custom: 3: /etc/grub.d/40_custom: linux: not found
    /etc/grub.d/40_custom: 4: /etc/grub.d/40_custom: initrd: not found
    I'll be glad if you'll help me.
    Last edited by howefield; December 29th, 2015 at 02:04 PM.

  6. #6
    Join Date
    Jun 2005
    Beans
    Hidden!

    Re: How to add Android-x86 entry to GRUB2?

    Hi george133
    Can you navigate to /etc/grub.d/40_custom and post the contents of that file here.
    Better yet just put this in the terminal and post the results back here..
    Code:
    gedit /etc/grub.d/40_custom
    So we can see what is what.
    Last edited by QDR06VV9; December 27th, 2015 at 04:47 PM.

  7. #7
    Join Date
    Nov 2015
    Beans
    22

    Re: How to add Android-x86 entry to GRUB2?

    Quote Originally Posted by runrickus View Post
    Hi george133
    Can you navigate to /etc/grub.d/40_custom and post the contents of that file here.
    Better yet just put this in the terminal and post the results back here..
    Code:
    gedit /etc/grub.d/40_custom
    So we can see what is what.

  8. #8
    Join Date
    Jun 2005
    Beans
    Hidden!

    Re: How to add Android-x86 entry to GRUB2?

    Well it would seem that you also removed the top portion of that file.
    It should read like my example below
    #!/bin/shexec tail -n +3 $0
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.
    So you now need to copy what I have above and add it to the top of that file and remove the "SDCARD=/data/sdcard.img"
    From there also.
    Now save that file and try again to boot to your Android-x86 OS.
    One more note here I probably would have waited to install Grub Customizer.... You can still get to Gurb by tapping the shift key as your computer is booting-up.

    Just a heads up It is not recommended that you use the "sudo -i" command to open GUI applications instead use <gksu or gksudo>.
    Last edited by QDR06VV9; December 27th, 2015 at 06:08 PM.

  9. #9
    Join Date
    Nov 2015
    Beans
    22

    Re: How to add Android-x86 entry to GRUB2?

    Quote Originally Posted by runrickus View Post
    Well it would seem that you also removed the top portion of that file
    No I didn't. What can I do? Can I replace this file with the default one?

  10. #10
    Join Date
    Jun 2005
    Beans
    Hidden!

    Re: How to add Android-x86 entry to GRUB2?

    Please read my post again.

Page 1 of 4 123 ... LastLast

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
  •