Wednesday, August 8, 2012

How to install Android 4.0 ICS in Virtualbox? Step by step installation guide

Finally day before yesterday I managed to install Android ICS with active ethernet and functional play store inside Virtualbox (which is inside Ubuntu 12.04). It took me 3-4 attempts with different ISOs. And to my rescue came the blog Android x86. I am heavily indebted to it, though I tweaked a few things here and there to make it work for me.

From Android 4.0 ICS

To begin, you need to download four things:

1. Virtualbox itself. You can get it from Ubuntu software center or from Virtualbox website. I have 4.1.18 for Linux, you can download for windows or mac as well, depending on your system. And install it.

2. Download the latest Android 4.0 version from Buil Droid. It is the OS which we'll be loading in virtualbox, 109.1 MB in size.

3. Android SDK files - the default android installed without any Play Store or apps. To install apps, you need it installed in your system. You can download it from here. Step by step instructions to install are given in the site itself.

4. Apps by by314 from this deposit files. It has some cool app collection like gmail, google maps, play store, etc. which we'll install in the vanilla android OS which we downloaded in couple of steps before.

Step 1: Once virtualbox is installed and Ova file from Buil Droid is downloaded, double click on the Android-4.0.3_bd2a.ova file. Automatically, it will install itself in virtualbox with predefined settings.

From Android 4.0 ICS

Click import and you'll see Android-4.0.3-bd2 in virtualbox.

From Android 4.0 ICS
Select it and press Enter, Android ICS will start and show you the grub.

From Android 4.0 ICS
Continue with the second option selected and it will boot Android. You'll see the default Android screen, like the one given below (this is after I changed the black-blue wallpaper and installed a few apps).

From Android 4.0 ICS

Open browser, internet should work. If it doesn't, go to virtualbox, select Android 4.0.3 bd2, click setting -> Network -> select Bridged Adapter as Attached to and wlan0 (if wifi) or eth0 (if your default system internet is through lan cord). Again restart Andriod, internet should work.

From Android 4.0 ICS
It will vanilla Android. In step 2, we'll install some cool apps along with market/play store. For that, go to Setting -> check about tablet to confirm you've Anroid 4.0.3 and finally go to Developer options -> check USB debugging for the outside system to connect to the Android inside virtualbox.

From Android 4.0 ICS

From Android 4.0 ICS
Step 2: In step 2, unzip (for Linux) install Android SDK to your linux or windows from the file you downloaded earlier. Installation will take a bit of time depending on internet connection. Follow the default instruction link provided in the Android SDK site.

Go inside Android-sdk-linux -> tools folder (for Ubuntu, Windows 7 one is easy, one simple .exe file), and click on Andriod.

From Android 4.0 ICS

From Android 4.0 ICS
Once installed, unzip the apps you had downloaded earlier. It has a folder named gapps_buildroid_modby314 inside. I purposively unzipped it inside ./Home/Arindam/Downloads so that I can access it easily via terminal.

Now open a terminal. Locate the adb file in the Android-sdk-linux -> platform_tools directory.

From Android 4.0 ICS
Another thing which is required is the IP of the Android distro. This is required as well are going to launch a FTP service to push the apps inside Android. I had the advantage of having scores of Linux distros inside my virtualbox and I checked ip configuration on one of them & found it be 192.168.1.4. So, I tried 192.168.1.5 onwards (my actual system has 192.168.1.3) and 192.168.1.6 worked.

To check if it is working, I opened browser inside Android OS running and typed in my system Linux (which is the main OS in my computer) terminal:
arindam@arindam-K55VM:~$ /home/arindam/Downloads/android-sdk-linux/platform-tools/adb connect 192.168.1.6
and it showed "connected to 192.168.1.4:5555". If it is unable to connect, it will show the same. Kind of trial and error method, but I didn't find any other method that worked for me.

Once you're able to connect, type
arindam@arindam-K55VM:~$ /home/arindam/Downloads/android-sdk-linux/platform-tools/adb remount

followed by
arindam@arindam-K55VM:~$ cd ./Downloads/gapps_buildroid_modby314

to move to the directory where your apps are.

And then we'll start pushing the apps by
arindam@arindam-K55VM:~/Downloads/gapps_buildroid_modby314$ /home/arindam/Downloads/android-sdk-linux/platform-tools/adb push system /system/

You'll see something of a screen below:

From Android 4.0 ICS
Once complete you'll see all the applications that we pushed inside Andriod. Close the browser that you had opened earlier and check the apps installed, you'll see gmail, playstore, maps, gtalk, etc.

From Android 4.0 ICS

From Android 4.0 ICS
It has superuser & terminal emulator as well. I installed GO Launcher EX from Play Store as well along with other free apps.

From Android 4.0 ICS
From Android 4.0 ICS

From Android 4.0 ICS
However, still this installation has quite a few limitations, like Facebook apk doesn't work with it, neither temple run. I'll do some research on how to make these fun apps work with the laptop installation; if I find something useful, I'll document it in my blog.

18 comments:

  1. Hi,

    I downloaded the desktop_generic.iso with wired connection enabled. It is quite nice and quick. How do I dual boot it with Linux distros?

    Regards!

    ReplyDelete
    Replies
    1. Hi Chdslv, to dual boot, first install Android and then the preferred Linux distro. The Linux distro's grub will automatically detect the android installation. Please let me know if it works for you.

      Regards!

      Delete
  2. If you could explain how to add apps and where are the repos, how it differs from Linux etc would be nice. I know how to get about the Linux folders, such as /etc, /usr, /boot etc, but how do I get about the Android files? Are they like Linux files? How do one make one's own distro out of Android? Lot of questions, but you write well. Hope you'd respond. Have a good day!

    ReplyDelete
    Replies
    1. Android file manager will show you the other linux installation files, etc. Android is essentially Linux so I don't think compatibility issues will be there. You can download the source codes from http://source.android.com/. Android is an open source project and you can tweak the source code in the way you wish to, I guess, even create your own OS.

      Thanks!

      Delete
    2. Hi Arindam,

      Do you know how to tweak Android and create your own OS? Could you write about that? It would be much appreciated!

      Delete
  3. Thanks, mate!!!! This howto works like a charm!!! To figure out th IP of the android guest i made "briged" network in the virtualbox and looked for the mac address in the DHCP table of my wireless router.
    Cheers!

    ReplyDelete
  4. hi, in Windows 7 how can i install apps?i didn't understand.

    ReplyDelete
    Replies
    1. Hi Taskin, this article deals with booting up Android ICS in virtualbox. You can install virtualbox for Windows from https://www.virtualbox.org/ and then follow my instructions.

      Also, there is a project going to install Android apps directly in Windows. You can please visit http://bluestacks.com/ and get further details.

      Thanks.

      Delete
  5. not able to connect to internet throgh android. i have downloded as per your instruction virtual bo and android

    ReplyDelete
    Replies
    1. Did you change the network configuration in virtualbox to bridged connection and wlan0 if you are using wifi / eth0 if you are using lan.

      Delete
    2. I HAVE THE BRIDGE CONNECTION OPTION IN ANDROID SETTING .. THERE IS NO SUCH SETTING IN VIRTUAL BOX.

      Delete
  6. it says "Can not access the kernel driver" on startup and the failed to open.
    Please help.

    ReplyDelete
  7. man it takes a long time to load first the boot screen comes then it exits some pids then the boot screen comes again and that process continues up till dooms day

    ReplyDelete
  8. I received the "Read-only file system" on adb push system /system. It was solved by adb remount.

    ReplyDelete
  9. Everything worked like a charm, except for two things: the terminal emulator crashes every time I try to run it, and (although the browser connects to the internet just fine) wifi is not configured, so android doesn't really realize it has a working internet connection.

    Every time I try to open the market, it takes me to the settings for the wifi, and is apparently unable to "turn the wifi on". The browser still has internet connection, it's just that the wifi is not set up and, as I cannot use the terminal, I cannot add ip settings manually.

    How can I make the terminal stop crashing, so that I can configure the ip settings?

    ReplyDelete
  10. Replies
    1. Please ifconfig and change to wlan0 for the default connection point.

      Delete
  11. when i tried to push the apps into it on terminal command it shows "error : device not found" what i do now

    ReplyDelete