Dual-Booting Ubuntu Netbook Remix and Android-x86 on an Asus Eee PC

I recently purchased a nearly new (open box) Asus EeePC 900 netbook from MicroCenter. Apparently, “open box” means that the Windows OS comes riddled with viruses, so I decided to reformat and install Android-x86.

Installing Android-x86

Tools needed:

Installation was relatively simple; I downloaded the USB image from the Android-x86 site, and burned it to a USB drive using Win32DiskImager.  In order to boot from the USB on the Eee PC, you have to pres Esc at the BIOS screen to bring up a boot device selection prompt, then select the USB drive from the menu.  Next, just follow the installation instructions on the Android-x86 site and in about 5 minutes you have Android up-and-running.

Overall I enjoyed playing with the android operating system, but despite its incredibly small installation footprint of about 166mb, I thought it fell short if you wanted to do more than browse the web and read email.  So, I decided to try out the Ubuntu Netbook Remix.

Installing Ubuntu Netbook Remix

Tools Needed:

Using UNetbootin, burn the Ubuntu Netbook Remix ISO to a USB stick (recommended over 2GB) in order to create a bootable USB drive containing the Ubuntu installation.  After UNetbootin completes its process and before rebooting, navigate to the USB stick’s contents and rename the syslinux.cfg file to syslinux.old.  Then in the isolinux folder rename isolinux.cfg and isolinux.bin to syslinux.cfg and syslinux.bin.  Lastly, rename the isolinux folder to syslinux.  Now, your bootable USB installation media is ready.

My particular netbook came with a 16GB SSD, which I formatted as follows:

Partition   Size     Type          Mount-point    Label
/dev/sda1   1024     ext3          none           Android-x86
/dev/sda2   24       unrecognized  none
/dev/sda3   4096     ext4          /              Ubuntu
/dev/sda5   2048     swap          none           
            8192     unallocated   none

Note: The 24MB FAT partition speeds up the XP boot process, so I decided to leave it in case I ever have the need to re-install XP at a later time.

The Ubuntu installation takes a little longer than Android does, and initially takes up about 2.5GB.

Modifying the Grub Configuration

Unfortunately, the Ubuntu bootloader did not auto-detect my installation of Android and load it into the boot menu, so I had to manually add the proper entries to the GRUB configuration.

Ubuntu 9.10 Karmic uses Grub 2, whereas Android uses an older version of Grub.  This means that you can’t simply copy the grub configuration lines directly from your Android partition without first translating the directives to their Grub 2 equivalent.  I mounted the Android partition and checked out the /grub/menu.lst file:

root (hd0,0)

title Android-x86 1.6-r2
	kernel /android-1.6-r2/kernel quiet root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode SRC=/android-1.6-r2
	initrd /android-1.6-r2/initrd.img

title Android-x86 1.6-r2 (Debug mode)
	kernel /android-1.6-r2/kernel root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode DEBUG=1 SRC=/android-1.6-r2
	initrd /android-1.6-r2/initrd.img

In order to add Android to my Ubuntu bootloader, I had to add the entries into the /etc/grub.d/40_custom file on my Ubuntu partition.  After some translation, my 40_custom file looked like this:

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 1.6-r2" {
	set root=(hd0,1)
	linux /android-1.6-r2/kernel quiet root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode SRC=/android-1.6-r2
	initrd /android-1.6-r2/initrd.img

menuentry "Android-x86 1.6-r2 (Debug mode)" {
	set root=(hd0,1)
	linux /android-1.6-r2/kernel root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode DEBUG=1 SRC=/android-1.6-r2
	initrd /android-1.6-r2/initrd.img

Running ‘sudo update-grub’ will compile the changes into the main GRUB configuration, and make the options available at next boot.

Note: I was having issues with the menu entries showing up initially.  As per the Dual-Booting errors section on the Ubuntu Wiki page for Grub 2 I issued the following command, and my changes to /etc/grub.d/40_custom finally appeared.

franklin@galadan-netbook:~# sudo apt-get install --reinstall libdebian-installer4
franklin@galadan-netbook:~# sudo os-prober
franklin@galadan-netbook:~# sudo update-grub

Further Reading

Learning Android Ubuntu Hacks: Tips & Tools for Exploring, Using, and Tuning Linux