ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Android Emulator Slow? Try Android x86 via VirtualBox (or similar)

(1/2) > >>

ewemoa:
Below are some notes on getting Android x86 working on VirtualBox (thanks to Gothi[c] for the original suggestion and tips in getting it all working!).  (It's unlikely that the steps couldn't be adapted to work with VMWare or similar.)

0. Ensure VirtualBox, the Android SDK, Eclipse, and the ADT are installed appropriately.

1. Download Android x86 Live CD:

     http://www.android-x86.org/download

  There are many there, but for these instructions:

     http://android-x86.googlecode.com/files/android-x86-4.0-RC2-eeepc.iso

     sha1:1953717ac1d606d57fc7d7293b367f8025c51b65

2. In VirtualBox create a new virtual machine:

   Type: Linux
   Version: Linux 2.6
   Memory: 512 MB
   Hard disk size: 3 GB

   Network Adapter 1: NAT (eth0 - for ordinary network access from android)
     PCnet-FAST III <- other cards may not work
   Network Adapter 2: Host Only (eth1 - for adb connection -- e.g. for eclipse)
     PCnet-FAST III <- other cards may not work

   IDE Optical Drive: Point to downloaded Android x86 live CD iso

3. Start virtual machine

4. Choose "Installation - Install Android-x86 to harddisk"

5. Choose Create/Modify partitions

6. Choose New -> Primary -> Size (default size)

7. Select Bootable

8. Select Quit

9. Select sda1 Linux VBOX HARDDISK

10. Select ext3

11. Confirm format action

12. Confirm installation of boot loader GRUB

13. Select Yes for /system directory read-write

14. Choose to run Android x86 and wait for it to start up (consider unmounting iso image too)

15. Disable mouse pointer integration for the virtual machine

16. Alt+F1 to get to virtual console (for reference: Alt+F7 to get back to Android UI)

17. netcfg to check network interfaces (eth0 for general net, eth1 for adb)

18. If eth1 is not up: netcfg eth1 up dhcp

19. Note the IP address (e.g. 192.168.56.101)

20. On host machine: via <android-sdk>/platform-tools:

      adb connect 192.168.56.101

21. Start Eclipse

22. Start some Android app via Run in Eclipse UI

23. In resulting dialog, choose running Android (should list one connected
     via 192.168.56.101)

24. If web browsing fails, it may be a DNS problem.  Try the following via a
     virtual console (Alt+F1): setprop net.dns1 <ip-address-of-dns-server>

25. To shutdown via Android UI: Two rapid entries of Host + H

     If the screen locks instead:

      1. Try to unlock and try again

      2. If the lock icon is not draggable, type the menu key (between right win and right control) and try again

    Possibly less safe ways of shutting down or rebooting (preface w/ sync?) via virtual console:

    # reboot -p

   # poweroff

References:

  http://blog.gokifu.com/2011/05/android-x86-faster-emulator/

f0dder:
Good idea for faster debugging cycles - just remember to still test in the emulator often, and on real hardware every now and then... unless you want to end up, 5 minutes before deadline, realizing that your code runs too slow on The Real Thing... or that the native code module you're using does unaligned memory accesses that work fine on x86, but crash on ARM :)

ewemoa:
Thanks for the advice :up:

ewemoa:
The emulator snapshot capability seems like it can alleviate the situation with the slow start-up:

  http://tools.android.com/recent/emulatorsnapshots

ewemoa:
AndroVM seems to be another alternative.

Some helpful hints here.

Seems to be working well here so far :)


"Wi-Fi" seems to work out-of-the-box for AndroVM whereas I didn't succeed in getting that working with the particular Android x86 ISO I tried.

Navigation

[0] Message Index

[#] Next page

Go to full version