Start Your Free Trial

Android in the Cloud: Running KitKat on Amazon EC2 and Google GCE

At Ravello Systems, our mission is to make the cloud look more like the datacenter. I have written about this many times, including on our advanced technology that makes this possible. In this blog, however, I will talk about something completely different: running the Android operating system in the cloud.

Android of course is Google’s smartphone operating system with a 79% market share. Together with Apple’s iOS, it forms the basis for a multi-billion dollar app economy.

The vast majority of Android devices today run on the ARM processor. When developing applications, developers can test their software by running it on an ARM emulator provided by Google as part of the Android SDK. The emulator is a full system emulator and is based on the QEmu open source project. It emulates an entire ARM-based handset and runs the Android operating system as a virtual machine inside it.

Unfortunately, running software on the ARM emulator is extremely slow, and slows down and frustrates many developers.

One solution that a lot of development shops and indies have adopted is to develop not on ARM but on an x86 version of Android. In theory, if your computer has the Intel or AMD hardware virtualization features, it is possible to run an Intel version of Android as a virtual machine at near native speed. The idea is that most of development and testing can be done on x86, and only the late stages of QA and acceptance would be done on ARM.

Multiple solutions exist for running Android on x86. A few common ones are:

>>> The Android SDK contains a system image for the Intel Atom processor. The emulator that’s included in the SDK can run the image at near native speed if hardware virtualization features are available. To access the virtualization extensions, the emulator uses KVM on Linux and Intel’s HAXM on Windows and Mac.

>>>  The Android-x86 project provides system images recompiled from the Android Open Source release that can be run on VMware, VirtualBox and QEmu/KVM.

>>>  The AndroVM project (now: Genymotion) provides a VirtualBox-based solution.

These solutions are mostly desktop solutions, and none of these solutions allow you to run Android in the cloud. Running Android in the cloud opens up very interesting use cases especially related to Continuous Integration. Imagine having a test suite that covers a large part of your code base and that can give you results within minutes of a commit. Extremely fast turnarounds like these can be achieved by running your tests on many parallel instances in the cloud – with no up-front costs, you pay only for what you use.

In the rest of this blog I will show you how to run the KitKat version provided by the Android-x86 project on Ravello.

In addition, we also support running the Android Emulator with hardware accelerationread more here.

The first thing to do is to download the .ISO file for the KitKat release candidate here. This ISO needs to be uploaded into the Ravello system using our CLI uploader tool:

 $ ravello import-disk -u android-x86-4.4-RC1.iso

The next step is to create a new application in the Ravello web UI, and then drag the  “Empty” VM to the canvas. Configure the VM to boot from the ISO you uploaded, as shown in the screenshot below.

1 VM Window

You should also add a supplied service called “adb” on port 5555, and make it external. We will use that below to connect to the image with the Android debugger. The result should look like this.

2 VM Creation by Ravello

You may now publish the application by clicking the Publish button. It takes a few minutes to allocate the cloud resources, and then you should see the following boot screen.

Ravello VM Console

Make sure to select the VESA mode option. Android will boot, and you will go through an initial configuration wizard. After a few menus, you will be presented with a familiar screen!

Ravello VM Console - Running Android

The Android OS can be accessed via our built-in graphical console. The screenshot below shows me using the built-in browser to browse the web.Install Android KitKAt using Ravello Systems 1

Due to the latency of the Internet connection, the graphical console experience is not as good as on your developer workstation. But for use cases like CI, that doesn’t really matter. To run commands remotely on this system we can use the Android Debugger (adb), which is part of the Android SDK. To connect to the Android VM, use:

 $ adb kill-server
 $ adb connect <publicip>:5555
 $ adb shell

Below is an example of an “adb shell” window that is connecting from my local workstation to the Android VM in the Cloud:

Install Android KitKAt using Ravello Systems 2

 You can also execute any of the other adb commands, such as “adb install” to deploy an APK.

That’s it. Hopefully this blog post was interesting to you. Feel free to leave feedback below.

To try it out yourself, you can sign up for a free 2-week evaluation period.

About Ravello Systems

Ravello is the industry’s leading nested virtualization and software-defined networking SaaS. It enables enterprises to create cloud-based development, test, UAT, integration and staging environments by automatically cloning their VMware-based applications in AWS. Ravello is built by the same team that developed the KVM hypervisor in Linux.

Android on the Cloud

Check our product demo video

Android in the Cloud: Running KitKat on Amazon EC2 and Google GCE
  • 超 牛

    Hi, I’m glad to see you guys have done this great job. I want to know how I can install android on ec2 without ravello. Can i get a hint? That would be great~. pS. love your system

  • Geert Jansen

    Hi 超 牛,

    it’s not easy to do it without Ravello. I’m not saying it’s impossible, but it’s far from trivial. If you search on Google you find a few people that (claim) they did it but they all seem to be very old references.

    Why not use Ravello? :) It will cost the same as using EC2 directly.


  • Roberto Andrade

    Have you guys actually tried publishing this to GCE? I’ve bee trying to do this by hand following GCE’s instructions for building custom images without any luck.

  • Gil Hoffer

    Hi Roberto,

    First of all, of course, this is running (using Ravello) both on GCE and AWS.

    It is quite hard to do so without Ravello as Geert mentioned below.

    Also, take a look at for an even better way of running Android on Ravello in the public cloud.