Android_x86 - How to set up dual boot with Mint in 5 mins.

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
User avatar
smurphos
Level 15
Level 15
Posts: 5944
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by smurphos »

Android-x86 is a project to port Android to desktop machines. It's a reasonably mature project which I've used on and off for several years installed via the method outlined in this tutorial.

Current releases based on Android 8.1 ship with Play Store access built in and a Desktop Friendly Taskbar launcher for the home screen.

It comes as a regular iso file which can be burned to a USB and installed like any other Linux distro on it's own, in multi-boot scenarios or in virtual-box. It's performance in virtual-box isn't great though.

It's also amenable to a quick and easy manual install for multi-boot that doesn't necessarily require separate partitions and has less risk of inadvertently breaking existing installed OS's. This tutorial outlines the manual install method.

Step 1 - Download the ISO

Download the current ISO from https://www.android-x86.org/download.html

For this tutorial I used the most recent stable 64bit release android-x86_64-8.1-r2.iso

Step 2 - Choose and create the install directory

You can use any location you like as long as it's not encrypted. You could install in your home folder, somewhere else in Mint file system, or on a separate partition. A fresh install takes up about 2GB of space in total. You''ll probably want at least 6GB available to allow for Android app installs.

For this tutorial I'll be installing into a dedicated directory added to Mint's root file system.

In a terminal create the directory to hold the installation. As I'm using the root partition I'll need to use sudo at this point, and then take ownership of the directory once created.

Code: Select all

sudo mkdir /android-x86
Take ownership of the new directory

Code: Select all

sudo chown $USER:$USER /android-x86
Make a data directory

Code: Select all

mkdir /android-x86/data
Step 3 - Extract the system, kernel, ramdisk and initrd images from the ISO

In your File Manager navigate back to the downloaded Android-x86 ISO, right click on it and open it with Archive Manager.

In Archive Manager select the 4 files as in the screenshot below before clicking extract.

Image

In the folder selection dialog navigate to the /android-x86 directory you created earlier and click extract

Image

You should now have the following content in the /android-x86 directory

Image

Step 4 - Create a grub menu entry

For this stage of the process you will need to make a note the UUID of the partition that you have used for the installation directory along with the full path of the directory.

To check the UUID open a terminal and run

Code: Select all

lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,UUID
My output is below. From this I can tell my root partition where I have created the /android-x86 directory has a UUID of d3abb04b-9d93-4004-a247-eff8481481d3

Code: Select all

steve@steve-Inspiron-5580:~$ lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,UUID
NAME          SIZE TYPE MOUNTPOINT             UUID
sda         931.5G disk                        
└─sda1      931.5G part /mnt/backup_drive      7f5c52d4-a3ee-44b1-bbbe-230bdb1e6d13
nvme0n1     238.5G disk                        
├─nvme0n1p1   512M part /boot/efi              0C7C-3863
├─nvme0n1p2  29.8G part /                      d3abb04b-9d93-4004-a247-eff8481481d3
├─nvme0n1p3  59.6G part /home                  464812ce-bfe2-4aae-8e50-66fc77f13bc2
├─nvme0n1p4  29.8G part                        0dd54e55-0107-41e5-9c73-6dff95358456
└─nvme0n1p6 118.8G part /mnt/virtualbox_images 398e2ad0-3f28-414f-a71e-ea46c9b8a3a0
Next open /etc/grub.d/40_custom in a text editor.

In a terminal run

Code: Select all

xed admin:///etc/grub.d/40_custom
At the bottom of the file add the following code block replacing %UUID% with the actual UUID of the partition containing the /android-x86 directory and %DIRECTORY% with the full path to the /android-x86 directory.

Code: Select all

menuentry 'Android-x86' --class android-x86 {
    insmod part_gpt
    set root='%UUID%'
    set DIR=%DIRECTORY%
    search --file --no-floppy --set=root $DIR/system.sfs
    linux $DIR/kernel root=/dev/ram0 androidboot.selinux=permissive quiet DATA=
    initrd $DIR/initrd.img
}
On my machine this entry looks like this

Code: Select all

menuentry 'Android-x86' --class android-x86 {
    insmod part_gpt
    set root='d3abb04b-9d93-4004-a247-eff8481481d3'
    set DIR=/android-x86
    search --file --no-floppy --set=root $DIR/system.sfs
    linux $DIR/kernel root=/dev/ram0 androidboot.selinux=permissive quiet DATA=
    initrd $DIR/initrd.img
}
Save the file and close the text editor.

Open a terminal and run

Code: Select all

sudo update-grub
Step 5 - Reboot and test!

Reboot, access grub and select the Android-x86 menu entry. You should shortly be booted into Android. Have fun.
Last edited by smurphos on Sun Sep 15, 2019 1:06 am, edited 1 time in total.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

User avatar
smurphos
Level 15
Level 15
Posts: 5944
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by smurphos »

Hints and Tips for Android-X86

Having installed and booted Android-X86 here are a few tips.

1 - Take care with external drives!

Android installed by this method will not be able to interact with the file-system of the partition/disk it it installed on - all of it's user data is stored in the data directory created during the installation. However Android will detect and automount any external discs connected to your machine - e.g USB disks, SD cards etc.

On first boot Android will ask how you want to use these discs. One of the options will be to format and incorporate into Android's internal storage. If you have data on the disc don't do this! The safe option is to select the option to use the external disc for transferring media. Personally I tend to eject them from the notification area just after boot.

2 - Application Compatibility

In Settings be sure to visit Android-x86 options and enable 'Native Bridge'. Without this set many Android apps and games will crash when you attempt to run them.

Image
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

cain2log
Level 1
Level 1
Posts: 7
Joined: Fri Feb 07, 2020 10:48 pm

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by cain2log »

Hi, smurphos,

Followed your instructions faithfully, only using /home/android-86 in my case. I managed to get Android-x86 to appear on the grub boot menu, but entering it only returns the following:

error: no such device: /home/android-86/system.sfs. [The file does exist in the stated path.]
error: disk '%UUID%' not found. [I am sure I copy/pasted my /home UUID correctly.]
error: you need to load the kernel first.

Press any key to continue..._

What am I to do?

I am a complete noob, just two weeks into testing my way into Linux Mint. I am not even sure if I am here violating the rule about adding support questions to tutorials, but I don't know where or how else to post my query to your tutorial. If I can get Android to dual boot with Linux Mint as you teach, you'd make me a very happy man.

cain

User avatar
trytip
Level 12
Level 12
Posts: 4458
Joined: Tue Jul 05, 2016 1:20 pm

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by trytip »

i'm itching to install something different on new ryzen tablet was thinking about phoenixOS or androidx86 and have never been able to add it correctly to the grub menu. i was able to boot it using the Super Grub2 Disk but then i realized i need an OS that has ROOT enabled

@smurphos, before i try this which i will dual boot with win10 is there a way to access ROOT in this installation so i can add my hosts file? i stayed away from android simply for the fact that i do not have root access
Image

User avatar
smurphos
Level 15
Level 15
Posts: 5944
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by smurphos »

trytip wrote:
Sat Feb 15, 2020 11:31 am
@smurphos, before i try this which i will dual boot with win10 is there a way to access ROOT in this installation so i can add my hosts file? i stayed away from android simply for the fact that i do not have root access
It ships with root access - configurable in Developer options.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

User avatar
smurphos
Level 15
Level 15
Posts: 5944
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by smurphos »

cain2log wrote:
Sat Feb 15, 2020 9:56 am
Hi, smurphos,

Followed your instructions faithfully, only using /home/android-86 in my case. I managed to get Android-x86 to appear on the grub boot menu, but entering it only returns the following:

error: no such device: /home/android-86/system.sfs. [The file does exist in the stated path.]
error: disk '%UUID%' not found. [I am sure I copy/pasted my /home UUID correctly.]
error: you need to load the kernel first.
Hi,

Lets check a few things - all are commands to be run in terminal. Please report the output (highlight the output in the terminal > right click and copy and then paste into your reply)

UEFI or BIOS

Code: Select all

dmesg | grep "EFI v"
Double-check the location of your android folder

Code: Select all

sudo find /home -type d -iname android*86
And it's contents

Code: Select all

ls $(sudo find /home -type d -iname android*86)
Double check your UUIDs

Code: Select all

lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,UUID
Double check your grub entry

Code: Select all

 cat /etc/grub.d/40_custom
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

User avatar
AndyMH
Level 10
Level 10
Posts: 3204
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by AndyMH »

Maybe a stupid question - wouldn't it be easier to install as a VM in virtualbox?
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

User avatar
trytip
Level 12
Level 12
Posts: 4458
Joined: Tue Jul 05, 2016 1:20 pm

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by trytip »

AndyMH wrote:
Sun Feb 16, 2020 7:30 am
Maybe a stupid question - wouldn't it be easier to install as a VM in virtualbox?
It's performance in virtual-box isn't great though :mrgreen: but what's the point of having virtualbox emulator which is not true hardware. i can barely play a NES (nintendo emulator) with my ryzen5 12GB RAM and NVME drive because of cpu and gpu not being optimized for this application.
virtualbox is good for tasting things, but if you want a feast and be satisfied, you need real hardware.
Last edited by trytip on Mon Feb 17, 2020 11:33 pm, edited 1 time in total.
Image

User avatar
smurphos
Level 15
Level 15
Posts: 5944
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by smurphos »

The problem with VBox is no Guest Additions exist for the Android variant of the kernel and thus there is no 3D acceleration, and thus it runs like a lame duck.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

cain2log
Level 1
Level 1
Posts: 7
Joined: Fri Feb 07, 2020 10:48 pm

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by cain2log »

Hi,

Lets check a few things - all are commands to be run in terminal. Please report the output (highlight the output in the terminal > right click and copy and then paste into your reply)
Thanks for your reply. Here's the output:

agila@agilamint:~$ dmesg | grep "EFI v"
agila@agilamint:~$ sudo find /home -type d -iname android*86
[sudo] password for agila:
/home/android-x86
agila@agilamint:~$ ls $(sudo find /home -type d -iname android*86)
data initrd.img kernel ramdisk.img system.sfs
agila@agilamint:~$ lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,UUID
NAME SIZE TYPE MOUNTPOINT UUID
loop0 91.3M loop /snap/core/8592
loop1 89.1M loop /snap/core/8268
sda 931.5G disk
├─sda1 350M part 64AC0BEEAC0BB996
├─sda2 558.6G part D2CAF1B4CAF194C7
├─sda3 1K part
├─sda4 186.3G part F0FAFD07FAFCCB3C
├─sda5 82.8G part A87CBA4F7CBA1850
├─sda6 19.1G part / c605dd38-55be-481b-989b-76552e43b007
├─sda7 4.8G part [SWAP] e6432d18-204e-43c0-9474-d961e0487d40
└─sda8 79.7G part /home 1be1e135-2aa1-49fc-b185-1f99dcc80d1c
sr0 1024M rom
agila@agilamint:~$ cat /etc/grub.d/40_custom
#!/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' --class android-x86 {
insmod part_gpt
set root='1be1e135-2aa1-49fc-b185-1f99dcc80d1c'
set DIR=/home/android-x86
search --file --no-floppy --set=root $DIR/system.sfs
linux $DIR/kernel root=/dev/ram0 androidboot.selinux=permissive quiet DATA=
initrd $DIR/initrd.img
}
agila@agilamint:~$

BTW, I'm not sure if this is relevant, but I am running Win10 and Linux Mint 19.3 in a dual boot. Successfully adding Android would make my system triple boot.

cain2log
Level 1
Level 1
Posts: 7
Joined: Fri Feb 07, 2020 10:48 pm

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by cain2log »

AndyMH wrote:
Sun Feb 16, 2020 7:30 am
Maybe a stupid question - wouldn't it be easier to install as a VM in virtualbox?
smurphos wrote:
Mon Feb 17, 2020 1:06 pm
The problem with VBox is no Guest Additions exist for the Android variant of the kernel and thus there is no 3D acceleration, and thus it runs like a lame duck.
I've tried Android in Vbox, from version 5.1 to 8.1 r3, trying without success to get Guest Additions to work. This is why i am eager to make smurphos's method to work.

User avatar
smurphos
Level 15
Level 15
Posts: 5944
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by smurphos »

cain2log wrote:
Tue Feb 18, 2020 8:55 am
######################################################################
menuentry 'Android-x86' --class android-x86 {
insmod part_gpt
set root='1be1e135-2aa1-49fc-b185-1f99dcc80d1c'
set DIR=/home/android-x86
search --file --no-floppy --set=root $DIR/system.sfs
linux $DIR/kernel root=/dev/ram0 androidboot.selinux=permissive quiet DATA=
initrd $DIR/initrd.img
}
agila@agilamint:~$

BTW, I'm not sure if this is relevant, but I am running Win10 and Linux Mint 19.3 in a dual boot. Successfully adding Android would make my system triple boot.
Thanks,

So the partition it's on is mounted as /home, so it's full path as far as that partition is concerned should be just /android-x86

Try this in /etc/grub.d/40_custom and run sudo update-grub after the edit. The output of the latter may be helpful if it doesn't work.

Code: Select all

menuentry 'Android-x86' --class android-x86 {
    insmod part_gpt
    set root='1be1e135-2aa1-49fc-b185-1f99dcc80d1c'
    set DIR=/android-x86
    search --file --no-floppy --set=root $DIR/system.sfs
    linux $DIR/kernel root=/dev/ram0 androidboot.selinux=permissive quiet DATA=
    initrd $DIR/initrd.img
}
If that doesn't work it may be a GPT vs MBR issue. In that case I'll need to do some research. the output of sudo update-grub may be helpful.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

cain2log
Level 1
Level 1
Posts: 7
Joined: Fri Feb 07, 2020 10:48 pm

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by cain2log »

smurphos wrote:
Wed Feb 19, 2020 3:19 am
So the partition it's on is mounted as /home, so it's full path as far as that partition is concerned should be just /android-x86
Yaaaay!!! Android is now in triple boot with Win10 and Linux Mint 19.3 on my laptop, and Android is running superfast compared to when it was in Vbox.

It was just as you said, the correct path of the partition was the point. And we can rule out the BIOS boot as culprit. Thanks for the lesson.

External drives and USB drives are also working perfectly, without my having to do anything more. Now, I'll go on exploring, especially on how to access Linux files from Android and vice versa (and Windows 10, too, although I am now just about to ditch Windows altogether)--or can you share the magic for this as well?

Many thanks.

sa38332
Level 1
Level 1
Posts: 1
Joined: Sat Mar 28, 2020 1:30 am

Re: Android_x86 - How to set up dual boot with Mint in 5 mins.

Post by sa38332 »

Hi, I have the exact same problem as cain2log but I have made sure that 'android-x86' is in the /android-x86 directory. What should I do?

Post Reply

Return to “Tutorials”