1. About
    1. Welcome
    2. Project News
    3. Architecture
    4. Community Wiki
  2. Get Involved
    1. Get the Code
    2. Mailing Lists
    3. Contributing
  3. Virtual Device
    1. Building
    2. Running
  4. Server Components
    1. Install
    2. Configure
  5. Client — Android
    1. Build & Install
    2. Using
  6. Client — iOS
    1. Build & Install
  7. Wire Protocol
    1. Protocol Description
    2. Extend and Build

Build the Android VM

Setting up a Build Environment

For the VM image itself, the build process is largely the same as for upstream AOSP, and much of the AOSP documentation on the subject applies. We highly recommend reading the following pages before continuing:

The AOSP documentation references the upstream master, which is currently developed beyond Android 4.4.×. There are some differences when it comes to the SVMP code. For instance, OpenJDK does not work reliably with Android 4.4, 4.2, or 4.0 as found in SVMP, and Oracle JDK 6 must be used instead.

If you don’t have access to a machine natively running the correct version, it is possible to create a working build environment inside a chroot, LXC or docker container, or VM. Many great guides for these are available on the web so we leave this as an exercise for the reader. Please consider contributing to the wiki if you find any particularly good approaches worth sharing.

SVMP 1.1 and newer

The SVMP v1.1-1.5 series is based off of Android 4.2.2 and SVMP v2.x is based off of Android 4.4. The recommended build environment for both is Ubuntu 12.04. The AOSP build environment instructions and required packages list for Ubuntu 12.04 are sufficient for these versions of SVMP. Ubuntu 14.04 also works, but requires some minor changes to the pre-requisite packages as seen in this container.

SVMP 1.0 and older

The SVMP 1.0 and earlier code is based off of Android 4.0.4. For this version, you will need a machine with Ubuntu 10.04 64-bit, and install the Ubuntu 10.04 required packages as listed in the upstream docs.

Building on MacOS

In the author’s experience, this has never successfully worked. The upstream documentation for this has substantially improved recently, but it still requires juggling out-dated versions of both the OS and Xcode. We recommend using a Linux VM instead.

Starting the Build

Summary:

1. cd ${SVMP_AOSP_ROOT}
2. ./build-svmp.sh
3. Answer the questions as prompted according to your preference. If you save your settings at the end, the menus will be skipped next time.
4. Compile

A complete build of Android from a clean tree can take a substantial amount of time depending on your hardware. Upwards of an hour for a full build is not uncommon.

Note: All of the questions the build process asks can be overridden using environment variables. Look in device/mitre/svmp/build-svmp2.sh to see what variables can be set. And/or, set the same values in the .svmp.conf file in the AOSP root dir.

A Note on Custom Signing Keys

If you choose to use custom signing keys, which we highly recommend you do, be aware that user data volumes will become bound to those signatures. If you try to attach a user data volume first initialized with one system image with one set of signatures, and then later pair it with another system image signed by a different set of keys, the instance will fail to boot.

If you do need to move a /data partition to a differently signed VM, you can clear the cached signatures by deleting the following two files:

All-in-one Image Builds

Starting in SVMP 1.5.0, a new “all-in-one” build target was introduced. This option will create a single unified disk image contained both the system and data partitions in a single disk image. This is useful in cases where there is no need to have long-lived persistent data volumes connected and removed from short lived system instances.

To select this option choose “All-in-one” as the “All-in-one image” page of the build script.