[Windows 8 Development and Hacking] cheatman:
Android How-to / guides section:

This section contains a set of guides to help you with some basic tasks and activities to easily manage your own installation(s) of Android. This is the part where the Magic Stick itself will prove to be useful and how you can use it to customize and repair or update anything. The Ubuntu related stuff is not documented here, as documentation and forums are available on the internet.

WARNING: These guides are not extremely detailed and include only the activities which have to be performed. Each configuration is different and you need to understand what you are doing to make sure you don't break anything. Worst case scenario is that you will lose all your data. However, you will still be able to boot the Magic Stick to repair or re-install everything (thank me later!)

DISCLAIMER: I am not responsible for any loss of data and you are at your own risk while using the tools, guides and information provided here. Back up your data and do not play around with systems that you use on a daily basis. Only follow these guides if you feel comfortable with the instructions and completely understand what you need to do at each step.

Make the Android system partition writable

When you download an Android-x86 release, you will find in the ZIP or ISO a bunch of files, including a file called "system.sfs" or "system.img".

If you have a file called "system.img" you can stop now, your Android system partition is writable and you can skip to the final step.

If you have a file called "system.sfs", then use the unsquashfs command to convert it into a writable format:

If you are using Windows, download the unsqashfs tool above and extract the zip. Drag and drop the "system.sfs" file on top of the unsqashfs executable to extract the system.img (you can find it inside the generated folder)

If you are using Linux, make sure squashfs-tools are installed and run this command from the folder containing the "system.sfs" file:

unsquashfs ./system.sfs

That's it, now you can mount the system.img file generated under linux using this command:

mount -o loop ./system.img /path/to/destination/

Resize the system partition

Usually, the system partition of Android-x86 is made as small as possible (you don't want to download "free space", right?) so if you want to add gapps or other packages to the system partition there will be no space left. Here's how to increase the size of the system partition:

Boot the Magic Stick into Ubuntu

Open a console using the Ctrl+Alt+T shortcut

Browse to the folder containing the system.img file (using 'cd' or 'mc')

Extend the system.img file by 200MB. Replace 200 with the amount of MB you want to add:

dd if=/dev/zero bs=1M count=200 >> ./system.img

Run gparted to also extend the partition inside the file:

sudo gparted system.img

In gparted, right click on the partition and select the option to shrink it down by only one MB (so it registers a change) and apply the changes

Close gparted. You're done.

Make space to install Android

Creating a new partition onto which to install Android usually requires shrinking an existing partition. If you want to install Android on the tablet (not the dock base) you will have to shrink the Windows system partition. Here's how to do it in a reasonably safe way:

Boot the Magic Stick into Ubuntu

Open a console using the Ctrl+Alt+T shortcut

Run gparted as root:

sudo gparted

In gparted, right click on the Windows system partition and select the option to shrink it down by at least 2GB. Make sure the partition actually has 2GB of free space, otherwise the process will not work.

Right click the free space and create a new partition and select to format it as ext4. It's important to make it ext4, so keep this in mind. Also give it a name such as "android".

Apply the changes and wait for the partition to be created.

Close gparted. You're done.

To have the partition available in Ubuntu Live, you have to mount it manually or just reboot (to have it mounted at boot automatically)

Install Android locally

Make sure you have the system.img, kernel, ramdisk.img and initrd.img files available. Make sure you have an ext4 partition mounted. The Android-x86 installation is in fact a simple process of copying the ISO/ZIP files onto the destination partition:

Boot the Magic Stick into Ubuntu

Open a console using the Ctrl+Alt+T shortcut

Copy the four relevant files to the ext4 partition using your method of choice

That's it, Android-x86 is installed (but not yet bootable!)

Enable data saving for Android

To enable data saving for Android-x86, you have many choices. However, the simplest one is to use an ext4 partition and create a dedicated "data" folder for android. Make sure Android-x86 is installed onto an ext4 partition:

Boot the Magic Stick into Ubuntu

Open a console using the Ctrl+Alt+T shortcut

Navigate to the root of the partition (the mount point folder)

Create a folder called "data":

mkdir -p data

You're done, Android will save data persistently across reboots.

Note that this only works for ext4 partitions.

Note that using ext2 or ext3 will output errors for Google Play if you use Lollipop builds.

You have been warned.

Install the grub2 boot loader

Resizing partitions and copying (read installing :D) Android is a very simple process. However, the bootloader installation is a much more complicated business (usually!). Here's how to make sure everything is installed correctly:

In progress...

Add the Android menuentry to grub2

Once we have grub2 installed and ready to go, it's time to make Adroid-x86 bootable as easily as possible:

In progress...

Update Android with new releases

Once Android is set up and ready to go, all you need to do to update it properly is to overwrite the existing files and reboot. Make sure you have the updated system.img, kernel, ramdisk.img and initrd.img files available. Make sure you have the Android ext4 partition mounted:

Boot the Magic Stick into Ubuntu

Open a console using the Ctrl+Alt+T shortcut

Copy the four relevant files to the ext4 partition using your method of choice, overwriting the existing ones

That's it, Android-x86 is updated

Cheers,

C.