Android-x86 ICS on VirtualBox

Awhile back I stumbled across a pre-made .vdi file with Android 4.0 ready to go for VirtualBox. The stock releases of Android-x86, which I had been using for Android 2.x systems in VirtualBox to test my Android app, hadn't yet supported ethernet in the 4.0 iteration. I was particularly happy to find ethernet support in the pre-made image, but it did have its limitations in terms of customization and SD card support (or at least documentation of them), for which Android-x86 had been very adept at both.

Fortunately, there appears to have been active discussion on this very topic on the Android-x86 mail list, and new builds have appeared that support ethernet out-of-the-box along with many other various improvements. So now if you need to test your Android app without having to plug in your device, you can once again take full advantage of the full suite of Android-x86 support. Here are some of the improvements I found:

  • Sounds support: now even button presses have a satisfying click, despite the lack of haptic feedback on my laptop.
  • Ethernet: with ethernet support, I can now connect directly from the host to the virtual machine via ADB for launching and debugging Android apps.
  • Google Play Store: somehow they managed to include the old Android Market, which seamlessly gets upgraded to the latest and greatest Play Store after first launch.
I had previously been quite excited and hopeful about the announcements of Intel x86-based Android support in the default Android emulator, which spoke of greatly improved performance using hardware-based acceleration. In my cursory tests, however, I continued to see a considerable performance lag both compared to my own actual device as well as the VirtualBox-based Android-x86 image. Perhaps I don't have the correct settings, or the Intel-based images may improve, but for now I'm happy to stick with the VirtualBox-based setup.

So how does one actually get the Android-x86 4.0 distro working in VirtualBox? The steps are similar to the previous description, with a few changes:
  • Grab a special android-x86-4.0-eth0 build, which includes the latest ethernet patches. As of the 20120327 build (but not on prior builds), I found that ethernet support allowed not only web browsing, but also the all important ADB access for Android app testing. I installed the "generic" package for use in VirtualBox.
  • Follow the previous instructions for setup and installation.
  • Turn off mouse integration through Machine > Disable Mouse Integration. Otherwise the mouse is nowhere to be found.
  • Turn off display sleep through Settings > Display > Sleep > Never time out. Otherwise after a period the time display can become unresponsive, even though the mouse still moves about.
  • When you want to shut down Android, you can press Ctrl-H to bring up the shutdown dialog (which I could never find in the pre-made image).
Now the big question for me is this: with Android successfully running within Windows, is it possible to replicate the Windows 8 (Metro mobile + classic desktop) experience via Android + VirtualBox + Window 7? Perhaps we shall see.



Comments

volker said…
thanks for the post!

Very nice VM, indeed!
Many apps from the Gmarket do not work, though.
Problem: with my old Dell D505 (pentium M) the browser does not work prperly: cannot access web pages. Problem does not exist with the dell e6500, though.

volker
David Young said…
Yeah I'm guessing that the Market filters out apps that don't run properly on x86 hardware? I do see a fair number of apps available when I run in VirtualBox, though I haven't browsed extensively. I had to restart the machine to actually download apps once (even though I could browse the store and web pages), perhaps because of an ethernet issue coming out of suspend.

I used to use one of those 505s as well! I've read that ICS is more resource hungry and uses a lot more hardware acceleration, particularly for the browser. I wonder if there's a compatibility issue with the 505's chipset?
volker said…
COncerning the d505: Suspecting the same thing, namely chipset compatibility.

In particular, since the older android versions, uncluding 2.3, run well (no browser problem) on the d505.
volker
David Young said…
Do you see any logcat output that might be of use when trying to load web pages? Is it possible to load pages in alternate browsers (eg Firefox)?
volker said…
GBrowser problem:
no log output.Browser just quietly closes after short while...

Ninesky browser: same problem; no webpages loaded!

Dolphin Browser: rotated screen. Anyway, appears to have the same problem.

Firefox: could not install it.

Found another nice x86 build:

http://www.ceh-photo.de/blog/

Problem even more severe: does not boot as VM on the D505 host (though nicely on the e6500).

volker
David Young said…
It looks like Dolphin and Ninesky use the same layout engine (WebKit) as the default Android browser, so I wonder if that's why they all aren't working.

Have you tried out NetFront? It appears to have its own NetFront engine, and I was able to install and run it on the VirtualBox device. Initially went into portrait mode, but then came back to landscape for actual browsing.
volker said…
Browser problem:
Have followed your previous suggestion and used "adb logcat *.E":
Browser crashes with

F/libc (1984) Fatal signal 4 (SIGILL) at 0x9cab41a1 (code2).

Will follow your suggestion to try - out Netfront. I'm familiar with the portrait mode problem.

volker
David Young said…
How did the NetFront browser work out?

I was also thinking that the Firefox nightly builds might be worth a shot since they're switching to a native UI that's quite different from the current one ( https://wiki.mozilla.org/Fennec/NativeUI ).
volker said…
thanks for your concern!

Tried NetFront -similar behaviour: browser starts, no webpages loading.

During install of the .apk, I had some problems with the playstore: said something like "cannot handle your purchase". Cleaning the Cache did not help. Had to re - install the VM. Any simpler solution for this problem?

volker
David Young said…
I haven't actually encountered that error myself, only the one where the files wouldn't start downloading at all without a system restart. Is it possible to uninstall/reinstall the store itself?

hmm...running out of browser options. Any chance that Opera is available? It uses its own Presto layout engine with an apparently unique design.
volker said…
sure, I will try a few things concerning the browser problem -not much hope,though.

What has really startled me is that the fact, whether the browser runs or not in the ICS - VM, depends on the underlying host hardware! I would have expected that, once an android build supports Virtualbox,it would run in any Virtualbox, independent on the underlying hardware. This obviously not true.

volker
David Young said…
Yeah it's interesting how much the browser in ICS appears to depend on the underlying hardware. Hopefully there will be would more browser alternatives with lower/simpler performance requirements for all of us trying Android on older hardware.

I did find TextOnly, a text-based browser that might have fewer requirements. Might be worth trying if you don't mind the lack of graphics.
volker said…
Thanks for your suggestions!

playstore problem:
go to settings -> apps -> google playstore -> deinstall all updates. This brings back the initial market icon -> install works again. I can live with that...

browser problem:
I like the TextOnly browser! Tested it in the VM on the other host. Finally, exported the VM to the old dell.

Browser finds all the links -> displays the title of the webpages -> BUT: does not access or show the content of the webpages!

At least, by now, we know that it has nothing to to with the graphics...

volker
volker said…
@dave

still the browser problem; some additional weird findings

Email: the list of incoming emails is shown with all clients (Gmail, Email). Opening an entry shows the header of the mail only, BUT the text of the mail is not displayed.

File Handling: installed Dropbox to access my .doc and .pdf - files. Used DocumentsToGo for .doc and MobilePDFViewer for.pdf. Text is indeed displayed, BUT only for about 30s.

Playstore (Market): works well. Could install .apk 's.

ALwaysOnPC.apk: opens a VPN to a cloud server under Linux. With the FF browser of the server I can see all webpages correctly.

After all, I start to believe that there is a timing problem.

Any more ideas?
volker
David Young said…
Wow, that's truly interesting behavior. I'm glad that at least you can view pages with AlwaysOnPC. I suppose that suggests that at least network connectivity is ok, with the ability to maintain an open stream.

With the doc and pdf files, does the app crash after 30s, or just go blank? Makes me wonder about timing issues like you mentioned, or perhaps refresh issues. Does increasing the base memory or video memory make any difference? If you open another activity on top of it and then return, does it refresh the app's display?
volker said…
browser problem:
yes, network works fine.

Doc and pdf files: the text disappears and I come back to Dropbox. That means the apps closes, I suppose.

Doubled the base and video memory ...without success.

Opening another activity when the viewers are open, appears to close them.

Thinking to use an older version of virtualbox. Any comment?


volker
David Young said…
Hm, I suppose trying an older version of VB is worth a shot, perhaps going back even to one of the 3.x series releases.

I saw this discussion from awhile back on the android-x86 list that sounded familiar with the logcat output you got after the browser crash. I wonder if it's related and if anymore work has been done with the toolchain? Seems like it could help for your system.
volker said…
browser problem with the d505:

tried VB-3.2:
not easy because I couldn't access the available.vmdk files anymore. Anyway, same behavior with the build on the d505 as far browser and .doc - files are concerned.Thus, I feel that the problems cannot be caused by VB.

Used UNetbootin: .iso boots on the e6500 and everything appears to work fine; on the d505 the .iso does not boot. Not very illuminating...

Presently, I'm waiting for a new build; not much hope as far the d505 is concerned.

volker
David Young said…
Yeah I'm looking forward to updated builds as well. Let me know how things go with the d505!

Have you tried Bluestacks on the d505 btw? I haven't tried it myself (just an early build that blue-screened my machine) but figured it might be another build to try.
volker said…
good to hear from you!

still the d505:
I got it working today(about 90 percent, maybe), but do not really understand why:

Took the android-x86-4.0-RC1-eeepc.iso (from android-x86.org)-> set up the VM -> boot successful. But, as I knew before, no internet ( with netcfg: -> eth0 is down). Did the following:
ALT + F1 -> netcfg eth0 up -> netcfg eth0 dhcp -> setprop net.dns1 8.8.8.8

Expected to get network connection. Indeed, network works. AND,at the same time the browser works fine; I can configure EMail (not GMail!!-> problem is that, as yet, I cannot access the market...) and read the text of the mails. Still, need to invest more time to check for other problems.

Now, we know that there is no problem with VB, and we know that there is no problem with the Browser. And, furthermore, I feel that there is no problem with the D505...

But, where is the problem with the android builds based on that of android-x86, such as the build of tabletsx86 (which comes with the network activated).

Do you know how to make the activation of the network permanent? Probably, I have to write something into /etc/init.sh?

Bluestacks: all my hosts are under linux; have to look for an linux alternative.

volker
David Young said…
That's great that you go the standard build working with the network! Sounds like it's mainly an issue of detecting the DNS server, and then manually pointing it to Google's DNS? Glad it worked on your D505, too. Yeah, makes me especially curious as to what about the tabletsx86 builds prevented basic web browsing on the D505.

I saw that tabletsx86 has new builds for Android 4.0.4. Perhaps a chance they work any better on your D505?

Regarding your network settings, can you set the DNS manually from the ethernet configuration in the settings panel? I imagine you could also write a shell script with those lines to execute manually or from /etc/init.d .
volker said…
Builds of tabletsx86.org:

Android 4.0.4: works fine on the dell e6500. On the D505, it boots as well, the browser does not load webpages nor is the text of emails shown. The same problems as with his android 4.0.3 build.

Android 3.2: I used his (most recent) generic-eth0-build (from Feb 2012). Hard to believe, but it works flawlessly also on the D505 (no problems with browser, text of email, use of DocumentsToGo to read my Dropbox files).Installation of apps (from the web) works also. Only problem: I cannot connect to my email server, can only configure GMail. But, this problem exist for the e6500 as well. Sadly, the build does not have the Gapps built - in.

Standard build (eeepc - RC1): its only problem on the D505 is with some Google apps, namely those which check whether a wifi connection exists (which is not available). I do not know how to force these apps, GMail and market in particular, to use eth0! (This problem exists for the e6500 as well.)

volker
David Young said…
If only there were some way to combine all of the best features of each of these builds! Sounds like a little of RC1 + 3.2 + tabletsx86 would be quite a match for your D505.

I realize this would probably be close to impossible/completely impractical, but perhaps you could run 2 or 3 of those builds simultaneously via VB on your D505? Would be total overkill though... After reading about Intel's new Android-based smartphone, I'm curious how that would work on older Intel chipsets, whenever it gets released.
volker said…
Using adb, it is not even too inconvenient to exploit the good features of the various builds:

f.i. I could use the ICS build of tabletsx86 which has the full market on the D505 (but no working browser) to download/install the apps. Then, I pull the apps to the host PC. Finally, I push them to the RC1 build which has a working browser.

In fact, I used already a similar procedure in the past when I had no access at all to the market. Then, I decided to have a small reservoir of important apps on my host PC:

3.2/honeycomb build of tabletsx86 (which has no gapps):
have installed the Gapps by moving them to /system/app. Cannot use market and Gmail because I cannot force these apps to use eth0 instead of wifi. Nevertheless, maps and latitude work well.

RC1 standard build of android-x86.org:
now eth0 is turned on during booting: I edited the /etc/init.sh - file (vi /etc/init.sh) by adding the required netcfg commands and the setprop - command.

Would be nice if I could contact tabletsx86. Do you know a way how to?

At least some small progress with the D505,
volker
David Young said…
That's a very impressive workflow! Looks like you've been able to take the best of each build on your D505 and turn your laptop into quite the hybrid Android machine.

I haven't contacted tabletsx86 except through posts on the Android-x86 Google group (which is where I learned about tabletsx86 in the first place). Apparently they mainly apply submitted patches that I imagine may eventually get merged into the main Android-x86 project.
volker said…
still some news concerning the "browser problem" with the dell D505 ...

got the following reply from tabletsx86.org:

"I can only speculate cause I'm not sure BUT:
the D505 is Celeron...check the forums as that has an issue with sse/sse2 instructions as I recall...there are solutions but most likely not included in the sources from git which we
build from..."

This is not entirely plausible to me because I do not have the problems with the "standard build", android-x86-4.0-RC1-eeepc.iso (from android-x86.org).

volker
Anonymous said…
the link to the drive is broken. Any chance to get that file somewhere else?
David Young said…
Thanks for pointing that out. It looks like you can pick up the latest files from that site here:

http://home.comcast.net/~rbg.tabletsx86/android-x86-builds.htm

Popular Posts