Dual Android- ICS


The below tutorial outlines how to run two instances of virtualized Androids on TI OMAP4 dual core Cortex-A9 panda board, using the pre-built binaries as well as the sources.

Demonstration details

  • The following demo is for RevC release of panda boards, having OMAP 4430 processors.
  • We will run two instances of virtualized Android kernels, parallely, over the Codezero hypervisor.
  • Android#0 will boot using the filesystem present on the SD card while Android#1 will boot via NFS filesystem exported by Android#0.
  • Android kernels as well as filesystems are based on android_4.0.3-r1/ICS AOSP release by Google.
  • Android#0 will boot on Core0 and Android#1 will boot on core1.

Hardware requirements

  • RevC panda board.
  • 4GB SDHC memory card.
  • HDMI display.
  • USB mouse/keyboard, preferably a wireless USB dongle over which both keyboard and mouse can work together.
  • Serial to USB converter.
  • Mini-USB to USB converter.

Downloading the pre-built binaries

Download binaries from here. It contains the following files

  • MLO – X-Loader
  • u-boot.bin – U-boot
  • Image – ELF file containing Codezero, Android#0 and Android#1 kernels and ramdisk.img of Android#0
  • system.img – Android#0 filesystem’s system binary image
  • userdata.img – Android#0 filesystem’s userdata binary image
  • ramdisk.img – Android#0 filesystem’s system ramdisk image
  • nfsdir.tar.gz – Android#1 filesystem tarball
  • nfs.tar – Tarball containing NFS scripts
  • panda-formatsd.sh – Script to format SD card

Setting up the demo

Install AOSP tools and configure fastboot device access by following the Installing AOSP host tools and Configuring USB Access sections of the Initializing the Host Environment page.

Format the SD card using

$ sudo panda-formatsd.sh /dev/sdX; here `sdX` is the block device corresponding to the SD card.

This will create a FAT partition named boot and an EXT3 partition named rootfs on the SD card.

Eject and re-plug the card on the host.

Copy MLO and u-boot.bin in the boot partition of the SD card.

Eject the card and plug it into the panda board.

Connect the board to the host machine via Mini-USB to USB converter.

Plug the HDMI display and USB keyboard/mouse to the panda board.

Connect the serial port of panda board to the host using serial to usb converter. And attach minicom to the serial converter device to get the panda boot logs and serial console

$ minicom -D /dev/ttyUSBn; here /dev/ttyUSBn is the usb to serial converter device.

Configure Minicom’s serial port for following settings

Baud Rate: 115200n8
Hardware flow control: OFF
Software flow control: OFF

Power on the board with Switch S2 key pressed, making the board go into the fastboot mode.

Flash the kernel and the filesystem on the SD card and boot

$ fastboot oem format
$ fastboot flash xloader MLO
$ fastboot flash bootloader u-boot.bin
$ fastboot erase cache
$ fastboot flash system system.img
$ fastboot flash userdata userdata.img
$ mkbootimg --kernel Image --ramdisk ramdisk.img -o paravirt-boot.img --base 0x80000000 \
            --kernel_addr 0xbd800000
$ fastboot flash boot paravirt-boot.img

Power off the board and plug the SD card into the host machine. Card will show two EXT4 partitions

system partition - that has a `build.prop` file, and
data partition - that does **not** have `build.prop` file

Follow the below instructions to set up NFS and Android#1 filesystem on the SD card

$ cd <data partition>
$ sudo cp nfs.tar .
$ sudo tar -xvf nfsdir.tar.gz

Eject the SD card and plug it back into the board.

Power on the board.

Successful setup should result in Android#0 GUI appearing over the HDMI screen and Serial console will be used by Android#1.

Switching GUI between Android#0 and Android#1

The actual control of HDMI is with Android#0. To switch to Android#1:

  1. Click on the AndroidVNC application and enter the following connection details IP-Address: and Port:5901.
  2. Connect. This should reveal the second full blown Android instance.

Known issues

  • First boot from the USB stick may take sometime. This limitation imposed by storage device speed.
  • Android#1 VNC screen may be a bit slower if used with high resolution settings. This limitation is imposed by the VNC client-server setup.
  • Keyboard inputs to Android#1 may not work initially. To enable key inputs, send “CTRL+ATL+SHIFT+F10″ input to Android#1 from the VNC client’s Send Keys option.

Building from sources

Check the Building from Source for Panda page for instructions on building Codezero and Android kernels from the sources.

Replacing Android#1 with Linux

To boot Linux based distribution instead of Android#1 follow exactly the same procedure as mentioned above, but instead of using nfsdir.tar.gz use buildroot based linux distro from here.

Follow the below instructions to set up NFS and Linux filesystem/distro on the SD card

$ cd <data partition>
$ sudo tar -xvf linux-vx-rootfs.tar.gz
$ sudo mv rootfs nfsdir
$ sudo chown 1000:1000 nfsdir/* -R

Also, to connect to the VNC server of Linux from Android#0 VNC client use the following settings

IP-Address:, Port: 5900, Colours/Bits per Pixel: 24(4bit)

Other than this, all the procedure is same as mentioned in Setting up the demo section above.

Once you are connected to the VNC server of Linux, if Linux screen shows black area in background i.e whole screen is not used by Linux, fix the screen geometry in <data partition>/nfsdir/etc/init.d/S32vnc; here pass the correct geometry to Xtightvnc based on your display resolution. Fix this and reboot.



Comments are closed.