How To Run Android 4.0 In Virtualbox (Linux)

By | October 9, 2013

Sometimes I need to test my app or try some new apps on main Android devices available on the market. Of course I don’t want to install them on my working cellphone. Under such circumstances, I prefer installing a virtual machine on my PC and testing whatever on it. Here in this post, I provide a way to run Android in Virtualbox.

  1. Choose an Android 4.0.3_r1 (20120518 build)

  2. Install (import) the package into VirtualBox

  3. Install Android SDK

    • Download Android SDK
    • Extract the file to “$ANDROID”, and go to $ANDROID/tools
    • run ./android and install Android SDK Platform-tools
  4. Set up NAT

    • Open VirtualBox
    • Go to buildroid VM’s Settings → Network
    • Under Adapter 1 tab, choose Attached to: NAT.
    • Expand Advanced and click Port Forwarding button.
    • Click Insert new rule button, input 5555 into Host Port and Guest Port.
    • Click OK to return to VirtualBox.
  5. Install Google play

    • Download Google apps
    • go to $ANDROID/platform-tools, and run
adb connect localhost
adb push $PATH/buildroid-gapps-ics-20120317-signed.tgz /sdcard/
adb shell
mount -o remount,rw /system
tar -xvzf /sdcard/buildroid-gapps-ics-20120317-signed.tgz
mount -o remount,ro /system

Leave a Reply

Your email address will not be published. Required fields are marked *