Wednesday, 22 November 2017

Android... on a Windows tablet?

It's easier than you think.

The Lenovo Miix 700 is a passively cooled Intel Core m7 in a tablet form factor. Perfect for a more compact system like Android.

Android, at its heart, is a Linux-based operating system, so if you are familiar with other Linux-based operating systems (like Ubuntu) or software development environments like MinGW, you might be more familiar with Android than you think. It is also easier to install and troubleshoot an Android dual-boot from a Linux operating system than from a Windows operating system.

The first thing to do would be to make a hard drive partition for Android. I won't go into detail how to do it, just need to know that you will need to shrink the partition for an existing drive and make a separate partition.

You will also need to download an Android distro. I have tried many distros, but the vanilla Android 7.1-rc2 x86-64 distro works the most satisfactory in my opinion for my uses.

Once you have the distro iso, you will need to burn it into a bootable USB drive. Nothing too fancy, you could use a card reader and an extra SD card for it. Use Rufus to burn the iso into a bootable USB drive.

Next thing to do if you are using a Windows system would be to download Grub2Win. It installs a bootloader that appears before your Windows boots and allows you to select the operating system. The thing about Grub2Win is that it allows you to change the UEFI settings from your Windows operating system. Just be careful with it.

Once you have installed Grub2Win, restart your computer to boot into the USB drive that you have stored your Android install in. To do this you will need to hold the Shift button while pressing the Restart button in the Windows Power button options. This will give you a few startup options. Press the appropriate options to boot from your USB drive.

When the computer reboots you will be given a few options to either boot into Android in Live mode or Install mode. Live mode means that Android will run directly from the USB drive but cannot store files or save any changes. This is for testing whether Android works well on your device before proceeding to install. Otherwise you could just directly install it.

When you install Android, confirm, double confirm, and double confirm plus chop which partition your blank partition is, because if you don't do it right, you might end up wiping your main Windows partition. And that's bad. This Android installation works with UEFI and GPT, so there should be no issue as long as your boot options in Grub2Win are set properly (this is important too!).

Once you have confirmed that you have selected the correct partition to install Android in, format it to ext4 and make sure it does not install Grub or Grub2, since you have already done that with Grub2Win. The formatting is why you need to be extra careful, since formatting will destroy ALL data in that partition if it is not empty.

There are two other file system options, FAT32 and NTFS, but there are issues with both of them when installing Android. FAT32 cannot use files larger than 4GB, which restricts the amount of data you can store in your Android partition. NTFS is not Linux-compatible, so a workaround is needed by storing a .img file inside the partition. Either way, your files on Android will not be viewable from your Windows operating system, so you might as well unmount it. Also, needing an .img file for storage severely slows down install time since the installation will need to create the .img file.

Since EXT4 is Linux-native, formatting your Android partition to EXT4, while making it unusable for Windows (not like you were planning to anyway), allows the available storage space to be as large as the partition allows minus the space for the necessary operating system files.

You still can't use Android after installation though, since you have not filed an entry for booting into Android using Grub2Win.

To use Grub2Win, you need to open it using administrative privileges. Open "Manage Boot Menu" to see the list of operating systems that you will boot into. Do not touch the Windows entry since you will need that to boot into your main operating system. Add an entry for the Android OS and use "Edit custom code". Then, read through this website to see what you should be doing to the configuration file.

For Android Nougat 7.1, you will also need to add an entry

android.selinux=permissive

just before the initrd entry so that it will boot properly without pulling an Emergency Remount R/O

Check spelling before you reboot. I spent two nights trying to troubleshoot an Emergency Remount because I didn't check the spelling, only to find out I left out an "n". 

That wasn't very fun to find. 

No comments:

Post a Comment