Adding Android x-86 to Grub bootloader menu after installation alongside Ubuntu
Installed Android x-86 on a computer after Ubuntu 24.04. Actually, not the first time. And actually, Windows 10 was installed on the same hard drive earlier. It turns out that three systems are side by side. But that's not the point.
The point is that after installing Android 86, it turned out that in the Grub boot menu that appeared there was no item for selecting Android 86 to launch, although during the installation, of course, I marked the necessary options.
The solution to this problem is to open the /etc/grub.d/40_custom file in Ubuntu, add a couple of lines to it and then run the sudo update-grub command in the terminal
However, I had problems with the correct entry for 40_custom. The entry was added to the bootloader, but when I tried to launch Android, an error popped up - the kernel file could not be found at the specified address.
In general, after much torment, below is the option that worked for me. This is the full contents of my file. Decided to save, maybe for myself in the future, or for someone who will search. Because when I searched on the forums, I did not come across this exact option.
#!/bin/sh
exec tail -n +3 $0
menuentry "Android-x86 9.0-r2" {
search --set=root --file /android-9.0-r2/kernel
linux /android-9.0-r2/kernel quiet root=/dev/ram0
initrd /android-9.0-r2/initrd.img
}
# 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.
After saving the file, do not forget to re-save grub by running the command in the terminal: update-grub
Added 01/01/2025: but I can say that Android x-86 is an inconvenient and buggy thing. If you have Ubuntu and want Android, install the Waydroid emulator directly on Ubuntu. I tested it, it is much better than the torment with Android x-86
The point is that after installing Android 86, it turned out that in the Grub boot menu that appeared there was no item for selecting Android 86 to launch, although during the installation, of course, I marked the necessary options.
The solution to this problem is to open the /etc/grub.d/40_custom file in Ubuntu, add a couple of lines to it and then run the sudo update-grub command in the terminal
However, I had problems with the correct entry for 40_custom. The entry was added to the bootloader, but when I tried to launch Android, an error popped up - the kernel file could not be found at the specified address.
In general, after much torment, below is the option that worked for me. This is the full contents of my file. Decided to save, maybe for myself in the future, or for someone who will search. Because when I searched on the forums, I did not come across this exact option.
#!/bin/sh
exec tail -n +3 $0
menuentry "Android-x86 9.0-r2" {
search --set=root --file /android-9.0-r2/kernel
linux /android-9.0-r2/kernel quiet root=/dev/ram0
initrd /android-9.0-r2/initrd.img
}
# 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.
After saving the file, do not forget to re-save grub by running the command in the terminal: update-grub
Added 01/01/2025: but I can say that Android x-86 is an inconvenient and buggy thing. If you have Ubuntu and want Android, install the Waydroid emulator directly on Ubuntu. I tested it, it is much better than the torment with Android x-86