What you will need:
Creating Android virtual machine and mount fake SD card
- Extract Android-v4.7z.
- Open VirtualBox.
- Add new machine, choose Linux as Operating System and Other Linux as Version.
- Choose Use existing hard disk, click Choose a virtual hard disk file icon and open Android-v4.vdi.
- Click Create.
- You have created a Android virtual machine. Now mount the SD card virtual disk image, click Settings, click Storage. Click Add Hard Disk icon which is beside IDE Controller, open sdcard.vdi. Set Android-v4.vdi as Master and sdcard.vdi as Slave.
- To allow Android Debug Bridge (adb) connect to Android Virtual Machine, still on the Settings page, click Network, under adapter 1 tab, click Port Forwarding button, enter 5555 into host and guest's port number and OK.
- The configuration in VirtualBox is done. Your Android virtual machine is ready to start. In this stage, it has Internet network and mounted a 8GB fake SD card.
- First, download a .apk file you want to install on put it into Android-v4 folder. For example, I want to install Android Terminal Emulator. I put the Terminal Emulator Term.apk file into Android-v4 folder.
- Open VirtualBox and start Android virtual machine.
- After that, press Shift key + right click on Android-v4 folder, then click Open command window here.
- To connect adb to Android Virtual Machine, enter this command: adb connect localhost
- adb has connected to Android Virtual Machine, I can now install Android Terminal Emulator by this command: adb install term.apk If you get the error "more than one device and emulator", use this to install: adb -s localhost:5555 install term.apk (Thank you Javier)
- Wait until the Success word appears and voila the Terminal Emulator application is installed on Android virtual machine.
I can't direct install apps (.apk) downloaded on Android ICS virtual machine. So, we use adb to install apps on Android virtual machine. Step 7 is very important.