Android development, VirtualBox and KVM

Few times already in the past couple years I tried doing some development for Android, but most of the time I decided to postpone that for another piece of undefined time.

The reason was that I always had issues with setting up the virtual device for debugging. And without debugging there is no development.

So, what was the problem? I always used a VirtualBox machine for development, having Windows as host and Ubuntu as guest. But to run AVD (Android Virtual Device), Linux uses KVM infrastructure; and according to StackOverflow, KVM can’t be run together with VirtualBox.

Although, KVM can be emulated, but then AVD is extremely slow (which I observed on the previous computer).

helloworldrealdevice

Solution? I pulled from the shelf one of my old Android phones (not to kill the tablet accidentally) and configured it to be a debugging device instead of AVD. Bingo 🙂

Virtualbox ‘error in supR3HardenedWinReSpawn’ on Windows 8

I have recently bought a desktop PC with Windows 8 on-board, and one of the first programs I installed was Virtualbox.

But unfortunately I’ve got a famous error ‘VirtualBox – Error in supR3HardenedWinReSpawn’ when running any virtual machine. In my case it was NtCreateFile error.

vb-error

Forums said that the error was introduced somewhere at version 4.3.14 and had to be fixed in later builds (current build is 4.3.28), but in the latest version I still observe the error.

Solution that worked for for me was uninstalling Windows update KB3045999 (to do that, go to Control Panel -> Installed Updates, find patch KB3045999, right click it, choose Uninstall).

Unfortunately, after some time Windows installed the update again, so I had to turn the automatic updates off.

What I tried and what did NOT help:

  • Playing with VirtualBox settings.
  • Downgrading to VirtualBox 4.2.* where some security features are not present yet.

Hope this helps someone.

Even better solution would be to use Linux 🙂