10

I have a small problem. I have seven partitions:

Device    Boot   Begin       End         Blocks     Id   System
/dev/sda1   *      206848   219013119   109403136    7  HPFS/NTFS/exFAT     <-- wINDOWS 7
/dev/sda2       219013120   735516671   258251776    7  HPFS/NTFS/exFAT     <--Musik,....
/dev/sda3       735516672   815638527    40060928    7  HPFS/NTFS/exFAT     <-- Android
/dev/sda4       815640574   976771071    80565249    5  Erweiterte          <-- No Idea:D
Partition 4 does not start at a physical sector boundary.
/dev/sda5       815640576   872494091    28426758   83  Linux               <--Kali Linux
/dev/sda6       970151936   976771071     3309568   82  Linux Swap / Solaris
/dev/sda7       872495104   970149887    48827392   83  Linux               <-- Ubuntu

I found a tutorial, but I tried this and it doesn't work. Here's the link:

http://www.webupd8.org/2012/03/how-to-dual-boot-android-x86-and-ubuntu.html

I used this Android from android-x86.org and the version android-x86-4.4-r1.iso.

This is my 40_Costum document:

#!/bin/sh
exec 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.
menuentry "Android-x86" {
set root='(hd0,3)'
linux /android-x86-4.4-r1/kernel quiet root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode SRC=/android-x86-4.4-r1
initrd /android-x86-4.4-r1/initrd.img}

If I start my PC the GRUB boot manager comes and I can choose Android, but it doesn't boot Android. The background is purple and nothing happens.

What would be a complete and working 40_Customm script?


It doesn't work if I make a script in Grub Customizer and save it. It doesn't show on the boot menu if I open the Grub Customizer again the script is removed.

This is my code :

set root='(hd0,3)' 
`search --no-floppy --fs-uuid --set=root 28D9FDF951298246  
linux android-x86/kernel root=UUID=28D9FDF951298246  quiet 
androidboot.hardware=generic_x86 SRC=/android-x86 acpi_sleep=s3_bios,s3_mode 
initrd Android-x86/android-4.4-r1/initrd.img

Now I have one extra Problem:

If I Start my laptop it shows Ubuntu, Windows, Kali Linux and Android (which doesn't work ), but if I start the GRub Costumizer the Windows isn't listed?! But Why?

7 Answers 7

3

Regarding Android x86 6.0

The "EEEPC" assignment is only for ASUS EEEPCs, only use it if you have one, otherwise use android_x86, do not use generic_x86, you will get stuck at the boot animation and have to restart by using CTRL+F1 to access the terminal and issue reboot as the GUI will not get loaded. I know this because I spent several hours following bad, though well intentioned, advice.

set root='(hd0,4)'
linux /android-6.0-rc1/kernel quiet root=/dev/ram0 androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode SRC=/android-6.0-rc1
initrd /android-6.0-rc1/initrd.img

This was the final configuration that worked for me on an old school SONY VAIO 64 bit on a triple boot setup.

'(0,4)' was the location of my hard drive and partition Android x86 was installed to, change it accordingly. You do not need your UUID, you only need exactly what I have put above with your installation location being the only change.

2

This is from XDA Developers

For GRUB 1.97 - 1.99 & 2.00 +

  1. To make it easy, install GRUB Customizer Type these into terminal emulator : Code:

    sudo add-apt-repository ppa:danielrichter2007/grub-customizer
    sudo apt-get update
    sudo apt-get install grub-customizer
    
  2. Open GRUB customizer and make a new GRUB entry.

  3. Open 'Sources' tab, type these :

    set root='(hd0,4)'
    search --no-floppy --fs-uuid --set=root e1f9de05-8d18-48aa-8f08-f0377f663de3
    linux androidx86/kernel root=UUID=e1f9de05-8d18-48aa-8f08-f0377f663de3 quiet      androidboot.hardware=generic_x86 SRC=/androidx86 acpi_sleep=s3_bios,s3_mode
    initrd androidx86/initrd.img
    

Here's what to change :

  1. set root='(hd0,4)' : Change the (hd0,4) to partiton Android x86 is installed. The hd0 means sda, so if you install it to sdb, it'll be hd1 and so on. The hd0,4 means the partition number, in my case, hd0,4 means sda4. So if you install it on sda6, it'll be hd0,6.

  2. --set=root e1f9de05-8d18-48aa-8f08-f0377f663de3 : The random number here is the UUID of partition Android x86 is installed You must change it to correct UUID, you can easily got UUID by creating new entry in GRUB Customizer then go to Options tab, then select the 'Linux' option in dropdown. You'll see partition dropdown, select your partition. Open the source tab, you'll see the UUID there.

  3. androidx86/ : The root of Android x86 Change it into your Android x86 root. You can see what's your Android x86 root by navigating to Android x86 partition, and you'll see a folder name started with 'android', that's the root of your Android x86

  4. androidboot.hardware : Your device, of course. Note : If you're using Android 2.3 - 4.0.3, change it to androidboot_hardware Here's the list of hardware :

  • generic_x86 : If your hardware isn't listed, use this
  • eeepc : EEEPC laptops
  • asus_laptop : ASUS laptops (supported ASUS laptops only)
2
  • I had to use an absolute path, i.e. /androidx86/kernel. Otherwise, I got an error about file not found.
    – banan314
    May 18, 2018 at 9:48
  • Could you please visit the question?
    – user1166068
    Apr 23, 2021 at 8:42
2
  • Open 40_custom:

    sudo -H gedit /etc/burg.d/40_custom
    
  • Add Android x86 menu entry:

    menuentry "Android-4.3-x86" --class android {
    set root='(hd*,msdos*)'
    linux /path/android-4.3-x86/kernel quiet root=/dev/ram0 androidboot.hardware=tx2500 acpi_sleep=s3_bios,s3_mode SRC=/path/android-4.3-x86 vga=788
    initrd /path/android-4.3-x86/initrd.img
    

    (set path and * as yours)

  • Update grub:

    sudo update-grub
    
1
  • This worked for me. I didn't add anything after 'root=/dev/ram0' on the 'linux' line, and had to add the closing bracket } after the 'initrd' line.
    – Ken H
    Apr 21, 2023 at 22:35
1

This is a ten month old question but I figured I'd help anyway. It's actually a very simple fix. I'm throwing the fix in my answer instead of hitting "edit" on the above answer because I don't want to wait for peer reviewing or whatever.

Anyway, the answer with the most votes states that you should use the following code:

set root='(hd0,4)'
`search --no-floppy --fs-uuid --set=root e1f9de05-8d18-48aa-8f08-f0377f663de3
linux androidx86/kernel root=UUID=e1f9de05-8d18-48aa-8f08-f0377f663de3 quiet      androidboot.hardware=generic_x86 SRC=/androidx86 acpi_sleep=s3_bios,s3_mode
initrd androidx86/initrd.img

The issue is in line two. There's a stray grave (`) at the beginning of line two. Literally as simple as that. Sometimes it's the most simple of things that make everything stop working.

I imagine that you either have found a way to add Android x86 to GRUB or you just don't care anymore but yeah. So here's the correct code:

set root='(hd0,4)'
search --no-floppy --fs-uuid --set=root e1f9de05-8d18-48aa-8f08-f0377f663de3
linux androidx86/kernel root=UUID=e1f9de05-8d18-48aa-8f08-f0377f663de3 quiet      androidboot.hardware=generic_x86 SRC=/androidx86 acpi_sleep=s3_bios,s3_mode
initrd androidx86/initrd.img

Here is my entire /etc/grub.d/40_custom file (excluding the exec tail and the commented out lines at the beginning):

menuentry "Android x86 4.4 R2" --class android --class gnu-linux --class gnu --class os {
    set root='(hd0,msdos2)'
    search --no-floppy --fs-uuid --set=root a47b5fe5-8969-4774-be9c-72c32a3fd14b
    linux /android-4.4-r2/kernel root=UUID=a47b5fe5-8969-4774-be9c-72c32a3fd14b quiet      androidboot.hardware=generic_x86 SRC=/android-4.4-r2 acpi_sleep=s3_bios,s3_mode
    initrd /android-4.4-r2/initrd.img
}
menuentry "Android x86 5.0.2 UNOFFICIAL" --class android --class gnu-linux --class gnu --class os {
    set root='(hd0,msdos4)'
    search --no-floppy --fs-uuid --set=root d2edeae9-3dc8-41b1-b775-25d0a8028092
    linux /android-2014-12-25/kernel root=UUID=d2edeae9-3dc8-41b1-b775-25d0a8028092 quiet      androidboot.hardware=generic_x86 SRC/android-2014-12-25 acpi_sleep=s3_bios,s3_mode
    initrd /android-2014-12-25/initrd.img
}

Obviously hd0,msdos2 is the partition that I have Android 4.4 R2 installed on and a47b5fe5-8969-4774-be9c-72c32a3fd14b is the UUID of said partition and hd0,msdos4 is the partition that I have Android 5.0.2 (unofficial and highly unstable) installed on and d2edeae9-3dc8-41b1-b775-25d0a8028092 being that partition's UUID.

For me, hd0,msdos2 is /dev/sdb2 and hd0,msdos4 is /dev/sdb4. I'm not sure on the following, but I think that GRUB does hd0, hd1, hd2, etc. in a different order than Linux does sda/hda, sdb/hdb, sdc/hdc, etc. Again, not sure, but I think GRUB does it in physical order (as they would be identified in your BIOS) and Linux does them in...uhh...some other way, I guess. Again, not sure on that.

But yeah if you need to figure out which partition in GRUB partition format (hdX,msdosY) your Android partition is (which I see is /dev/sda3), restart your PC and hit C to go to a command line. Then type (hd and hit tab (tab autocompletes things) and it will then list all drives as autocomplete options (not 100% sure but I'm like 70% sure it doesn't display USB drives unless they're SATA drives connected with a USB to SATA adapter). Then type (hd0, and hit tab and it will list all partitions on hd0 as autocomplete options. If you have multiple drives, figuring out which one /dev/sda3 is just a matter of trial and error with using autocomplete on (hd. I'm not sure exactly what the results look like but I do know for a fact that the results for (hd0, will (obviously) display the GRUB-style partition identifiers for all partitions on hd0 (for you, it'd be msdos1 through msdos7; in GRUB, hd starts at 0 but msdos starts at 1), the labels of all the partitions on hd0, and the filesystem (usually you throw Android x86 onto ext2 but since you have it on NTFS, it'd display the filesystem as NTFS; for most people it'd display ext2 which is how I know which one it is because my Android partitions are the only ext2 partitions I have).

Hmm...I had initially intended to only correct the mistake in line two of the most popular answer and I ended up with a damn near full tutorial on how to add Android x86 to GRUB...

0

None of the other answers worked for me, so I decided to find the solution myself in the files provided by the ISO image with Android-x86 installation files.

In Android-x86 LiveCD1/efi/boot/android.cfg I found the following menu entry:

set root=$android
linux $kdir/kernel root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug $src $@
initrd $kdir/initrd.img

The question was what the values of $kdir and $android should be. After mounting the partition I installed the system on (sda2), I found the name of the directory - cm-x86-14.1-r2.

$@ are additional parameters (quiet in my solution) and $src can be ignored. Finally, I made the following grub entry:

set root='(hd0,2)'
linux /cm-x86-14.1-r2/kernel quiet root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug
initrd /cm-x86-14.1-r2/initrd.img

And it works.

0

This was all very helpful, but in the end, it was missing a small bit for me and it wouldn't work until I added in all the parts.

set root='(hd0,2)'
linux /cm-x86-14.1-r2/kernel quiet root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug
initrd /cm-x86-14.1-r2/initrd.img

As posted by Banan3'14 was right, but it was missing:

search --no-floppy --fs-uuid --set=root a47b5fe5-8969-4774-be9c-72c32a3fd14b

Maybe that was implied and I'm too new to have gotten that, but once I got it all together, it worked.

    set root='(hd0,2)'
 search --no-floppy --fs-uuid --set=root a47b5fe5-8969-4774-be9c-72c32a3fd14b
    linux /cm-x86-14.1-r2/kernel quiet root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug
    initrd /cm-x86-14.1-r2/initrd.img
-1

Don't bother with the sda or sdc, it is always (hd0,x) in my case if you installed the android x86 to the booting device. That's to say, in my case, whether your device is listed in os like ubuntu as /dev/sda or /dev/sdb, you should add (hd0,x), x is the number of your android x86 partition, in the grub 2 item, as long as you boot up with the same device you installed your android x86(for example, you installed android x86 in a usb drive named U at partition 3, and U listed in your ubuntu as /dev/sdc, but you boot from U, then you should add root=(hd0,3) but not root=(hd2,3) in the grub).

1
  • I tried to improve your answer. But can't make head or tail of it. You can change your answer if you click on the edit link below your answer.
    – MadMike
    Nov 3, 2014 at 6:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .